HP 7475A
Graphics Plotter
INTERFACING
AND
PROGRAMMING
MANUAL
RS-232-C/CCITT V.24
A DESIGNED FOR,.
<esh>
^ SYSTEMS"
The United States Federal Communications Commission
(in 47 CFR 15.838) has specified that the following notice
be brought to the attention of users of this product.
FEDERAL COMMUNICATIONS COMMISSION
RADIO FREQUENCY INTERFERENCE
STATEMENT
“This equipment generates and uses radio frequency energy and
if not installed and used properly, that is, in strict accordance with
the manufacturer’s instructions, may cause interference to radio
and television reception. It has been type tested and found to
comply with the limits for a Class B computing device in
accordance with the specifications in Subpart J of Part 15 of FCC
Rules, which are designed to provide reasonable protection
against such interference in a residential installation. However,
there is no guarantee that interference will not occur in a
particular installation. If this equipment does cause interference
to radio or television reception, which can be determined by
turning the equipment off and on, the user is encouraged to try to
correct the interference by one or more of the following
measures:
— reorient the receiving antenna
— relocate the computer with respect to the receiver
— move the computer away from the receiver
— plug the computer into a different outlet so that computer and
receiver are on different branch circuits.
If necessary, the user should consultthe dealeroran experienced
radio/television technician for additional suggestions. The user
may find the following booklet prepared by the Federal Com¬
munications Commission helpful:
‘ How to Identify and Resolve Radio-TV Interference Problems’.
This booklet is available from the US Government Printing Office,
Washington, DC 20402, Stock No. 004-000-00345-4.”
HP 7475A
Graphics Plotter
INTERFACING
AND
PROGRAMMING
MANUAL
©1983,1987 by Hewlett-Packard Company
16399 W. Bernardo Drive, San Diego, CA 92127-1899
NOTICE
The information contained in this document is subject to change
without notice.
Microsoft® is a U.S. registered trademark of Microsoft Corporation.
PRINTING HISTORY
First Edition — June 1983
Revision to First Edition — October 1984
Second Edition — November 1986
Manual Summary
Chapter 1: Getting Started
Contains information concerning manual usage, a description of the
plotter, its interfaces, the HP-GL language, and four instructions.
Chapter 2: Establishing Boundaries and Units
Explains the concept of plotting area, plotter and user units, scaling,
and the instructions used to set and output the scaling points and
window, to scale the plotting area, and to rotate the coordinate system.
Chapter 3: Controlling the Pen and Plotting
Describes the instructions for pen control, vector plotting, and for
defining and filling rectangles and arc segments.
Chapter 4: Enhancing the Plot
Describes instructions for drawing tick marks and differentiating traces.
Chapter 5: Labeling
Describes the instructions used in labeling to set direction, size, and
slant of characters, as well as instructions for character set and label
terminator selection and for designing your own characters.
Chapter 6: Digitizing
Describes the instructions used to digitize with the plotter and demon¬
strates how to check for the presence of a digitized point.
Chapter 7: Obtaining Information from the Plotter
Describes the instructions used to obtain information about pen posi¬
tion, errors, and capabilities of the plotter.
Chapter 8: Putting the Commands to Work
Three examples illustrating the procedures to be followed to draw
labels and plot data using HP-GL instructions.
Chapter 9: HP-IB Interfacing
Summarizes operation of the plotter with the Hewlett-Packard Interface
Bus (HP-IB) and explains the methods for addressing and sending and
receiving data over the interface bus.
Chapter 10: RS-232-C/CCITT V.24 Interfacing
Describes how to connect the plotter with a terminal and/or computer,
summarizes the methods for establishing a handshake protocol be¬
tween the plotter and computer, and explains the device control instruc¬
tions that are used to set up and control the handshake protocol.
Appendix A: An HP-IB Overview
Provides an overview of the Hewlett-Packard Interface Bus (HP-IB).
MANUAL SUMMARY ill
Manual Summary (Continued)
Appendix B: Instruction Syntax
Provides a summary of both HP-GL and device control instructions.
Appendix C: Reference Material
Includes a summary of default conditions, error messages, scaling
equations, NOP instructions, ASCII codes, and character sets.
IV MANUAL SUMMARY
Table of Contents
Chapter 1: Getting Started . 1-1
What You’ll Learn in This Chapter. 1-1
HP-GL Instructions Covered. 1-1
Terms You Should Understand. 1-1
How to Use HP 7475 Documentation . 1-2
For First Encounters with the 7475 . 1-2
For First Encounters with HP-GL. 1-2
For Experienced HP-GL Programmers . 1-3
Understanding Manual Conventions and Syntax . 1-3
A Brief Look at the 7475 Plotter. 1-4
The 7475 Plotter’s Instruction Set . 1-5
HP-GL Syntax. 1-6
How to Use the Examples in This Manual . 1-10
Examples Presented as Complete Programs . 1-10
Examples Presented as HP-GL Strings . 1-11
The Default Instruction, DF . 1-12
The Initialize Instruction, IN . 1-13
The Input Mask Instruction, IM . 1-14
The Paper Size Instruction, PS. 1-16
Looking Ahead . 1-17
Chapter 2: Establishing Boundaries and Units . 2-1
What You’ll Learn in This Chapter. 2-1
HP-GL Instructions Covered. 2-1
Terms You Should Understand. 2-1
The Plotting Area. 2-2
Unit Systems. 2-5
The Plotter Unit . 2-5
User Units . 2-5
Setting the Scaling Points . 2-5
Setting PI and P2 Manually. 2-6
The Input PI and P2 Instruction, IP. 2-7
The Output PI and P2 Instruction, OP . 2-8
The Scale Instruction, SC. 2-9
The Input Window Instruction, IW . 2-12
The Output Window Instruction, OW. 2-13
The Output Hard-clip Limits Instruction, OH . 2-13
The Rotate Coordinate System Instruction, RO . 2-14
TABLE OF CONTENTS V
Table of Contents (Continued)
Chapter 3: Controlling the Pen and Plotting . 3-1
What You’ll Learn in This Chapter. 3-1
HP-GL Instructions Covered. 3-1
Terms You Should Understand. 3-1
The Pen Instructions, PU and PD. 3-2
The Select Pen Instruction, SP .. 3-3
The Velocity Select Instruction, VS . 3-3
The Plot Absolute Instruction, PA. 3-4
The Plot Relative Instruction, PR . 3-8
Plotting with Variables. 3-10
How to Send Variable Parameters. 3-10
The Circle Instruction, Cl . 3-11
The Arc Absolute Instruction, AA. 3-15
The Arc Relative Instruction, AR . 3-18
The Fill Type Instruction, FT . 3-20
The Pen Thickness Instruction, PT. 3-22
The Shade Rectangle Absolute Instruction, RA . 3-23
The Edge Rectangle Absolute Instruction, EA . 3-25
The Shade Rectangle Relative Instruction, RR . 3-26
The Edge Rectangle Relative Instruction, ER . 3-28
The Shade Wedge Instruction, WG . 3-31
The Edge Wedge Instruction, EW . 3-34
Chapter 4: Enhancing the Plot . 4-1
What You’ll Learn in This Chapter. 4-1
HP-GL Instructions Covered. 4-1
The Tick Instructions, XT and YT. 4-2
The Tick Length Instruction, TL... 4-2
The Symbol Mode Instruction, SM . 4-4
The Line Type Instruction, LT . 4-6
Chapter 5: Labeling . 5-1
What You’ll Learn in This Chapter. 5-1
HP-GL Instructions Covered. 5-1
Terms You Should Understand. 5-1
Plotter Character Sets. 5-2
The Designate Standard Character Set Instruction, CS . 5-3
The Designate Alternate Character Set Instruction, CA. 5-3
The Select Standard Set Instruction, SS . 5-4
vi TABLE OF CONTENTS
Table of Contents (Continued)
Chapter 5: Labeling (Continued)
The Select Alternate Set Instruction, SA . 5-4
The Define Terminator Instruction, DT . 5-5
The Label Instruction, LB . 5-7
Labeling with Variables . 5-8
The Absolute Direction Instruction, DI . 5-10
The Relative Direction Instruction, DR . 5-12
Spacing Between Characters . 5-13
The Character Plot Instruction, CP . 5-14
The Absolute Character Size Instruction, SI . 5-16
The Relative Character Size Instruction, SR . 5-17
The Character Slant Instruction, SL . 5-18
The User Defined Character Instruction, UC. 5-19
Parameter Interaction in Labeling Instructions . 5-23
Use of DI and SI. 5-23
Advanced Programming Tips. 5-29
Chapter 6: Digitizing . 6-1
What You’ll Learn in This Chapter. 6-1
HP-GL Instructions Covered. 6-1
Terms You Should Understand. 6-1
Preparing Your Plotter for Use as a Digitizer. 6-2
The Digitize Point Instruction, DP . 6-2
The Digitize Clear Instruction, DC . 6-3
The Output Digitized Point and Pen Status Instruction, OD. 6-3
Digitizing with the 7475 . 6-4
Manual Method. 6-4
Monitoring the Status Byte . 6-5
Example — Digitizing by Monitoring the Status Byte . 6-5
Example — Digitizing Many Points . 6-6
HP-IB Interrupts and Polling . 6-7
Chapter 7: Obtaining Information from the Plotter . 7-1
What You’ll Learn in This Chapter . 7-1
HP-GL Instructions Covered. 7-1
Terms You Should Understand. 7-1
A Brief Word about Plotter Output . 7-2
Notes for an HP-IB User . 7-2
Notes for an RS-232-C User . 7-2
TABLE OF CONTENTS vii
Table of Contents (Continued)
Chapter 7: Obtaining Information from the Plotter (Continued)
The Output Actual Position and Pen Status
Instruction, OA. 7-2
The Output Commanded Position and Pen Status
Instruction, OC . 7-3
The Output Error Instruction, OE . 7-5
The Output Factors Instruction, OF . 7-6
The Output Identification Instruction, 01. 7-6
The Output Options Instruction, 00 . 7-6
The Output Status Instruction, OS . 7-7
Summary of Output Response Types . 7-9
Chapter 8: Putting the Instructions to Work . 8-1
What You’ll Learn in This Chapter . 8-1
Line Chart . 8-2
Setup and Scaling . 8-2
The Axes and Their Labels . 8-3
Plotting Your Data. 8-5
Listing . 8-8
Bar Graphs and Pie Charts. 8-9
Filling and Hatching. 8-9
Producing a Bar Graph . 8-9
Producing a Pie Chart. 8-13
Chapter 9: HP-IB Interfacing . 9-1
What You’ll Learn in This Chapter. 9-1
HP-IB Implementation on the 7475 . 9-2
Interface Switches and Controls . 9-2
Addressing the Plotter . 9-2
Bus Commands. 9-4
Reaction to Bus Commands DCL, SDC, and IFC. 9-4
Serial and Parallel Polling. 9-4
Addressing the 7475 as a Talker or Listener. 9-6
Computers with No High Level I/O Statements. 9-6
Computer with High Level I/O Statements . 9-6
Sending and Receiving Data. 9-7
Computer-to-Plotter . 9-7
Plotter-to-Computer . 9-10
viii TABLE OF CONTENTS
Table of Contents (Continued)
Chapter 10: RS-232-C/CCITT V.24 Interfacing
What You’ll Learn in This Chapter. 10-1
Setting Up Your RS-232-C Plotter: a Checklist . 10-2
Plotter Environments . 10-2
Using a Plotter Directly Connected to a
Computer Mainframe or Personal Computer. 10-2
Using a Plotter in an Environment with a Terminal. 10-4
Using the Plotter in a Terminal-only Environment . 10-9
Connecting the RS-232-C Interface . 10-10
Output Baud Rate . 10-13
Stop Bits . 10-14
Transmission Errors . 10-14
Handshaking. 10-15
Software Checking. 10-18
Xon-Xoff Handshake. 10-20
Enquire/Acknowledge Handshake . 10-21
Hardwire Handshake . 10-23
Data Transmission Mode. 10-23
Normal Mode. 10-23
Block Mode. 10-23
RS-232-C Device Control Instructions. 10-24
Syntax for Device Control Instructions . 10-25
The Plotter On Instruction, ESC . ( or ESC . Y . 10-26
The Plotter Off Instruction, ESC .) or ESC . Z. 10-26
The Set Plotter Configuration Instruction, ESC . @. 10-27
The Output Buffer Space Instruction, ESC . B . 10-28
The Output Extended Error Instruction, ESC • E . 10-29
The Set Handshake Mode 1 Instruction, ESC . H. 10-32
The Set Handshake Mode 2 Instruction, ESC .1. 10-33
The Abort Device Control Instruction, ESC . J . 10-35
The Abort Graphic Instruction, ESC . K . 10-36
The Output Buffer Size Instruction, ESC . L . 10-36
The Set Output Mode Instruction, ESC . M . 10-37
The Set Extended Output and Handshake Mode
Instruction, ESC . N . 10-38
The Output Extended Status Instruction, ESC .0. 10-42
The Reset Handshake Instruction, ESC . R . 10-44
TABLE OF CONTENTS ix
Table of Contents (Continued)
Appendix A: An HP-IB Overview . A-l
HP-IB System Terms . A-l
Interface Bus Concepts. A-l
Message Concepts . A-2
The HP Interface Bus . A-4
HP-IB Lines and Operations. A-4
Interface Functions . A-7
Bus Messages . A-8
Appendix B: Instruction Syntax . B-l
HP-GL Syntax. B-l
RS-232-C Instruction Syntax.B-l 7
Appendix C: Reference Material . C-l
Binary Coding and Conversions . C-l
Binary-Decimal Conversions . C-l
Scaling Without Using the SC Instruction . C-2
Plotter Default Conditions . C-5
HP-GL Error Messages. C-6
RS-232-C Error Messages . C-6
The No Operation Instructions, NOP. C-7
ASCII Character Codes . C-7
Subject Index . SI-1
x TABLE OF CONTENTS
_
_
_
_
□
-
-
TABLE OF CONTENTS xi
Chapter
Getting Started
What You’ll Learn in This Chapter
This chapter explains how to use this manual and other manuals you
may need or find useful. In addition, this chapter describes:
• The 7475 Graphics Plotter’s features
• Its two interfaces
• The plotter’s language and syntax
• Four instructions from the plotter’s language, HP-GL (Hewlett-
Packard Graphics Language).
HP-GL Instructions Covered
DF The Default Instruction
IN The Initialize Instruction
IM The Input Mask Instruction
PS The Paper Size Instruction
Terms You Should Understand
HP-GL — Hewlett-Packard Graphics Language — the two-letter-
mnemonic graphics language understood by the 7475 plotter and other
HP graphics devices. The instruction’s mnemonic is suggestive of its
role. For example, PA is used to plot to absolute coordinates, SP is used
to select a pen, and DR is used to establish the relative direction of
labeling.
HP-IB — Hewlett-Packard Interface Bus — HP’s implementation of
the IEEE standard 488-1978 digital interface for programmable instru¬
mentation is commonly found on HP desktop computers and some
larger computers. The HP-IB interface is standard on the Option 002
plotter.
RS-232-C/CCITT V.24 Interface — another popular standardized inter¬
face. It is commonly found on large computers, personal computers,
and where communication between a terminal and a computer over
telephone lines is required. This interface is standard on the Option 001
plotter.
GETTING STARTED 1-1
How to Use HP 7475 Documentation
This manual contains interfacing and programming information for
the HP 7475 Plotter and its interfacing options. The Option 001 plotter
is equipped with the RS-232-C/CCITT V.24 Interface. The Option 002
plotter is interfaced through the Hewlett-Packard Interface Bus (HP-IB)
which conforms to ANSI/IEEE 488-1978 specifications. All interfaces
use the Hewlett-Packard Graphics Language (HP-GL) for control of
plotter graphics capabilities. Unless specifically noted, all information
in this manual pertains to all configurations.
NOTE: All information in this manual for Option 001 plotters applies
equally to RS-232-C and CCITT V.24 interfaces. For purposes of sim¬
plicity, both are referred to as RS-232-C. ■
Documentation for this plotter is designed so that you can use the
plotter easily. All plotters are shipped with this manual, an Operation
and Interconnection Manual (Part No. 07475-90002), and a Reference
Card (07475-90004). The Operation and Interconnection Manual con¬
tains all the information you will need to physically connect your
plotter to certain computers, and to verify that the connection has been
made. It also contains information on how to operate, but not program,
your plotter. The Reference Card lists the plotter’s HP-GL instructions
with their parameters, its device control instructions for the RS-232-C
version, and the error numbers and their meanings.
For First Encounters with the 7475
If you have just received your HP 7475, read the Operation and
Interconnection Manual before attempting to operate the plotter. After
inspecting your plotter, its power cord, and accessories as described in
the Operation and Interconnection Manual, refer to the appropriate
chapter of this manual for initial setup and addressing or handshaking
protocol for your configuration. RS-232-C users should read Chapter 10,
and HP-IB users should read Chapter 9.
For First Encounters with HP-GL
If you have never programmed in HP-GL, after reading the interfacing
chapter, read Chapters 1 through 5 in order. These chapters describe
the instructions you will use in almost every application. Be sure you
run the examples given with the instructions, as this will help you
learn HP-GL. Next, read Chapter 8 to see how all the instructions work
together in a program. When you have an application requiring digitiz¬
ing or plotter output, read Chapters 6 and 7.
1-2 GETTING STARTED
For Experienced HP-GL Programmers
If you are an experienced HP-GL programmer, you may find Appen¬
dix B of this manual or the Reference Card most helpful. Since there
are differences in syntax between this and other plotters, you should
read Chapter 1 of this manual before programming. The 7475 has
added capabilities not found in earlier plotters. Among these are the
ability to plot to non-integer user-unit values, to mirror labels using
negative size and direction parameters, to output the current window
values, and to rotate the plotter unit and user-unit coordinate systems
90 degrees. To understand these differences, you need to read the
sections on scaling (SC, Chapter 2), rotation (RO, Chapter 2), plotting
(PA and PR, Chapter 3), and setting label size and direction (DR, DI,
SR, and SI, Chapter 5). In the instruction set summary in Appendix B,
page numbers for the complete description are listed with each
instruction.
Understanding Manual Conventions and Syntax
Before reading any part of this manual, you should understand the
meaning of type styles, symbols, and number representation used in
text. A detailed explanation of syntax symbols is given in the section
entitled HP-GL Syntax in this chapter and Instruction Syntax for
Device Control Instructions in Chapter 10. The following conventions
also apply. Words typed in small boldface type are either buttons,
sw itches, or words actually found on the plotter or computer. Headings
in |j]3!i3j£d tyP e are used to help locate specific parts of the writeup of
an instruction. type in a smaller size is used to denote a single
ASCII character which should be sent to the plotter. Numbers are
typed using SI (International System of Units) standards; numbers
with more than four digits are placed in groups of three, separated by a
space instead of commas, counting both to the left and right of the
decimal point (54 321.123 45).
GETTING STARTED 1-3
Follow the documentation road map below:
A Brief Look at the 7475 Plotter
The HP 7475 Graphics Plotter is a vector plotter which produces high
quality, multicolor graphics plots on four sizes of drawing media:
ISO A4 (210 X 297 mm) ANSI A (8V2 X 11 in.)
ISO A3 (297 X 420 mm) ANSI B (11 X 17 in.)
1-4 GETTING STARTED
The 7475 can produce distinctive graphics not only on standard paper,
but also on other media such as transparency film. The plotter offers
both high plotting speed and excellent line quality, using Hewlett-
Packard’s paper-moving technology. This technology uses low-inertia,
grit-covered wheels to move the paper in one axis while the pen moves
along the other axis. The 7475 plots with approximately 2 g acceleration
and a maximum velocity of 38.1 cm/s (15 in./s). The result is exceptional
line and character quality and high throughput. The 7475 has an
addressable resolution of 0.025 mm (0.000 98 in.) and a repeatability of
0.10 mm (0.004 in.) for any given pen.
On your 7475, you can produce multicolor graphics by programmed or
front-panel selection of six pens. If you desire additional colors, you can
stop the program and manually install additional pens. Symbol-mode
plotting and seven different dashed-line fonts provide additional trace
identification capabilities.
Using character plotting speeds of up to two characters per second, you
can produce fully-labeled graphs quickly. Using any of 19 character
sets, you can readily annotate your graph with text in any direction,
with or without character slant, and in varying sizes. Finally, with the
area fill instructions, you can easily fill segments of a pie chart or
rectangle.
The 7475 is engineered to be especially useful in the areas of business
graphics, statistics, medicine, numerical control, surveying, and engi¬
neering design. With an optional overhead transparency kit, you can
produce high quality graphic transparencies from your plotting pro¬
grams. For faster comprehension, you can present economic trends,
engineering or scientific data, marketing plans, profit data, or sales
forecasts pictorially. And with this choice of media, you can create
paper hardcopy for an individual’s attention or transparencies for
group presentations.
Whether you tabulate, measure, or compute data, depend on the reliable
7475 to prepare multicolored plots of excellent line quality and high
resolution.
The 7475 Plotter’s Instruction Set
Both interface configurations for the HP 7475 plotter use the same
Hewlett-Packard Graphics Language (HP-GL) instruction set. HP-GL
consists of two-letter mnemonic instructions which activate the plotter.
A table listing the instructions alphabetically is located at the end of
the next section. Syntax descriptions and explanations of these instruc¬
tions are contained in Chapters 1 through 8. Six additional HP-GL
instructions cause no operation but are included for compatibility with
other HP plotters. These instructions are listed in Appendix C.
GETTING STARTED 1-5
Fourteen additional instructions, called device control instructions, are __
required by the RS-232-C configuration. These instructions are used to
establish plotter output and handshake protocol, and to control condi¬
tions which are pertinent only to the RS-232-C environment. In an _
RS-232-C plotter, all HP-GL instructions enter the plotter’s internal
buffer and are executed in a first-in, first-out sequence. All device
control instructions, except . L, do not enter the buffer, but instead __
are executed immediately upon receipt. Refer to Chapter 10 for the
syntax description and an explanation of the device control instructions.
HP-GL Syntax “
An HP-GL instruction is a two-letter mnemonic followed by its parame- ___
ter field, if any, and a terminator. If parameters follow the mnemonic,
they must be separated from each other by at least one comma or
space, or by a + or — sign which may be preceded by commas or ___
spaces. Optional commas and/or spaces may be used as separators
before, after, and between the mnemonic and before the terminator. An instruc¬
tion is terminated by a semicolon or by the next mnemonic. If you have ___
an HP-IB plotter, a line feed can also terminate an instruction. (Note
that if you have an RS-232-C plotter, a line feed is not a valid
terminator.) All instructions will execute immediately after the mne- — __
monic or last possible parameter is received. If too many parameters
are sent, the instruction will be executed with the required number of
parameters and error 2 is set (wrong number of parameters). The __
syntax is shown below.
NOTE: This syntax is true for every instruction except the SM and DT
instructions. These instructions will interpret the first character after
the mnemonic as the symbol or label terminator, respectively. ■
INSTRUCTION PARAMETER FIELD
MNEMONIC (AS REQUIRED)
(AS REQUIRED)
Sep X Sep X Sep Parameter Sep Parameter Sep Terminator
OPTIONAL SEPARATORS
(0 OR MORE COMMAS
AND/OR SPACES)
REQUIRED SEPARATOR
NOTE: The syntax used on the 7475 is extremely flexible and differs
from the HP 9872. Therefore, any software written for the 7475 which
takes advantage of its less rigorous syntax may not drive other HP
plotters. If software is to be used with other HP-GL plotters, the more
rigorous syntax of the HP 9872 plotter should be used.
1-6 GETTING STARTED
XX Parameters (,Parameters) Terminator
INSTRUCTION
; FOR RS-232-C PLOTTERS
; OR LF FOR HP-IB
PLOTTERS
-OPTIONAL PARAMETERS
The 9872 syntax does not allow separators between the characters of
the mnemonic.- One comma must separate parameters. Only; or LF
may be used as the terminator for HP-IB plotters, and only ; may be
used as the terminator for RS-232-C plotters. In addition, parameters
requiring integer format may not contain a decimal point or decimal
fraction. ■
Some instructions have optional parameters which, when omitted,
assume a default value. To omit a parameter, all subsequent parameters
in the same instruction must be omitted. The exceptions to this rule are
the parameters of the FT and UC instructions.
The label instruction, LB, is a special case; it must be terminated with
the label terminator character. This character defaults to the ASCII
end-of-text character, ETX, whose decimal equivalent is 3. The label
terminator may be changed from its default value using the define
terminator instruction, DT.
The parameter fields must be specified in the format defined by the
syntax of each respective HP-GL instruction. The format can be of four
types:
1. Integer Format — a parameter in integer format between -32 768
and +32 767. Decimal fractions of parameters which must be
integers are truncated. If no sign is specified, the parameter is
assumed to be positive.
2. Decimal Format — a number between -128.0000 and 127.9999 with
an optional decimal point and decimal fraction with up to four
significant digits. If no sign is specified, the parameter is assumed to
be positive.
3. Scaled decimal format — a number between -32 768.0000 and
+32 767.9999 with an optional decimal point and decimal fraction
with up to four significant digits. If no sign is specified, the parame¬
ter is assumed to be positive.
NOTE: Scaled decimal format is used only when user-unit scaling is
active. This format applies to all HP-GL instruction parameters that
are interpreted as user-units. ■
4. Label Fields — any combination of text, numeric expressions, or
string variables. Refer to The Label Instruction, LB, Chapter 5, for a
complete description.
GETTING STARTED 1-7
Some instructions such as PA, PR, PU, and PD may have multiple
parameters. Separators are required between these parameters. These
optional parameters are shown in parentheses in the syntax descriptions.
The syntax shown under the description of each HP-GL instruction
uses the following notations:
MZVemonic For readability, the mnemonic is shown upper¬
case and separated from the parameters and/or
terminator.
necessary parameter All typeset items are required parameters.
( ) All items in parentheses are optional.
c . . . c Any number of labeling characters.
(,...) Any number of X,Y coordinate pairs.
terminator ; or the next mnemonic. LF is also valid for the
HP-IB plotters. An instruction followed by a pa¬
rameter must include a terminator.
The following table shows the 7475 , s HP-GL instruction set.
Plotter Instruction Set
Instruction
Description
AA
X [i/sd], Y [i/sd], arc angle [i]
(,chord angle [i])
Arc absolute
AR
X [i/sd], Y [i/sd], arc angle [i]
(,chord angle [i])
Arc relative
CA
n[i]
Designate alternate set n
Cl
radius [i/sd] (,chord angle [i])
Circle
CP
spaces [d], lines [d]
Character plot
cs
n [i]
Designate standard set n
DC
Digitize clear
DF
Set default values
DI
run [d], rise [d]
Absolute direction
DP
Digitize point
DR
run [d], rise [d]
Relative direction
DT
c[c]
Define label terminator
EA
X [i/sd], Y [i/sd]
Edge rectangle absolute
ER
X [i/sd], Y [i/sd]
Edge rectangle relative
EW
radius [i/sd], start angle [i],
sweep angle [i] (,chord angle [i])
Edge wedge
1-8 GETTING STARTED
Plotter Instruction Set (Continued)
Instruction
Description
FT
type [i] (.spacing [sd]
(.angle [i]))
Fill type
IM
e [i] (,s [i] (,p [i]))
Input e, s, and p masks
IN
Initialize
IP
Plx [i], Ply [i] (,P2x [i], P2 y [i])
Input PI and P2
IW
X l0 [i], Yi 0 [i], X hi [i], Y h i [i]
Input window
LB
c . . . c [c]
Label ASCII string
LT
t [d] (.1 [d])
Designate line type and
length
OA
[i return]
Output actual position and
pen status
OC
[i/sd return]
Output commanded position
and pen status
OD
[i return]
Output digitized point and
pen status
OE
[i return]
Output error
OF
[i return]
Output factors
OH
[i return]
Output hard-clip limits
01
[c return]
Output identification
00
[i return]
Output options
OP
[i return]
Output PI and P2
OS
[i return]
Output status
OW
[i return]
Output window
PA
X [i/sd], Y [i/sd] (,...)
Plot absolute
PD
(X [i/sd], Y [i/sd] (,...))
Pen down
PR
X [i/sd], Y [i/sd] (,...)
Plot relative
PS
paper size [i]
Paper size
PT
thickness [d]
Pen thickness
PU
(X [i/sd], Y [i/sd] (,...))
Pen up
RA
X [i/sd], Y [i/sd]
Shade rectangle absolute
RO
n [i]
Rotate coordinate system
RR
X [i/sd], Y [i/sd]
Shade rectangle relative
SA
Select alternate character set
SC
Xmin [i], Xmax [i], Y m in [i], Y m ax [i]
Scale
SI
width [d], height [d]
Absolute character size
SL
tan0 [d]
Absolute character slant
(from vertical)
GETTING STARTED 1-9
Plotter Instruction Set (Continued)
Instruction
Description
SM
c[c]
Symbol mode
SP
n [i]
Select pen
SR
width [d], height [d]
Relative character size
ss
Select standard character set
TL
tp [d] (,tn [dj
Tick length
UC
(pen [i],) X [d], Y [d], pen [i]
(,...)
User defined character
VS
v[d]
Select velocity v
WG
radius [i/sd], start angle [i],
sweep angle [i] (,chord
angle [ij
Shade wedge
XT
X-axis tick
YT
Y-axis tick
[c] = character format
[i] = integer format, —32 768 to +32 767
[sd] = scaled decimal format, —32 768.0000 to +32 767.9999
How to Use the Examples in This Manual
The examples in this manual are designed primarily to show the use of
the instruction with which they appear. If you are new to programming,
try entering and running some examples on your computer. You might
then wish to change some parameters in an instruction and rerun the
plot. The examples are presented in two ways, either as complete
programs or as listings of only the pertinent HP-GL strings.
Examples Presented as Complete Programs
Some examples are presented as complete programs, written in a
version of Microsoft® GW BASIC for MS™-DOS operating systems.
This BASIC is used by several popular personal computers.
Be sure you have established the proper handshaking protocol before
running these programs. The 7475A Operation and Interconnection
Manual contains configuration examples for several personal com¬
puters. If your computer is not listed there, refer to your computer’s
documentation. It will tell you how to establish communication between
your computer and the plotter.
Following is a simple example of the way complete program appears in
this manual. You will always need a configuration statement at the
1-10 GETTING STARTED
beginning of your program, however, the statement will vary according
to the language of your computer.
For plotters with an RS-232-C interface, the configuration state¬
ment in line 10 is for Microsoft® GW BASIC.
10 OPEN "COM! : 96 00,N,8,1 ,RS,CSG5535,DS,CD'‘ AS #1
20 PRINT#!
30 PRINT#!
40 PRINT#!
50 PRINT#!
60 PRINT#!
70 END
" IN;SP1;PU3000 ,5400;"
'PD2600,4200,1400,3800 ,2600 ,3400;“
"PD3000 ,2200,3400,3400,4600,3800;"
'PD3400,4200 ,3000 ,5400;"
"SP0;"
For plotters with an HP-IB interface, the following configuration
statements can be used in line 10 of BASIC programs.
10 OPEN, ”0" ,#1, “PLT" (Series 100/BASIC)
10 OPEN, "LPT3 = " FOR OUTPUT AS #1 (GW™-BASIC)
The PRINT#1 statement sends the HP-GL instructions, via an output
file, to the plotter. Here 1 corresponds to the file number in the OPEN
statement.
If you are not using Microsoft® GW BASIC, you will need to insert
the proper configuration statement in line 10 and may need to change
the PRINT#1 statement as well. Refer to your computer’s documentation.
When programming in another language, substitute the output or input
statement of your language for the BASIC statements PRINT#1 and
INPUT#. Change FOR... NEXT loops, etc., to whatever statements
are comparable in your language. All characters enclosed in quotes in
program listings must be sent to the computer using a form of output
statement. In addition, some variables, which are not included in
quotes, may need to be sent.
Examples Presented as HP-GL Strings
Since input/output instructions (e.g., PRINT# and INPUT#) do vary so
much in different computer languages, many examples present only
the pertinent HP-GL strings (the two-letter mnemonics and applicable
parameters). They are enclosed in quotation marks since many com¬
puters use quotation marks as string delimiters. The plotter does not
require the quotation marks; use whatever your computer requires.
GETTING STARTED 1-11
The Default Instruction, DF
DESCRIPTION
The default instruction, DF, sets certain plotter func¬
tions to a predefined state.
HKlfti This instruction can be used to return the plotter to a known
state while maintaining the same settings of PI and P2. As a result,
unwanted graphics parameters such as character size, slant, or scaling
are not inherited from another program.
SYNTAX
DF terminator
No parameters are required; if a parameter is supplied,
the instruction will execute and error 2 will be set.
A DF instruction sets the following plotter functions to the conditions
shown in the table below.
Default Conditions
Function
Equivalent
Instructions
Conditions
Plotting mode
PA;
Absolute (PA)
Relative character
direction
DR1,0;
Horizontal (DR1,0)
Line type
LT;
Solid line
Line pattern length
LT;
4% of the diagonal distance
between PI to P2
Input window
IW;
Set to current hard-clip
limits
Relative character size
SR;
Width = 0.75% of (P2 X - Pl x )
Height = 1.5% of (P2 y — Pl y )
Symbol mode
SM;
Off
Tick length
TL;
tp = tn = 0.5% of (P2x — Plx)
for Y-tick and 0.5% of
(P2 y — Pl y ) for X-tick
Standard character set
CSO;
Set 0
Alternate character set
CAO;
SetO
Character set selected
SS;
Standard
Character slant
SLO;
0 degrees
Mask value
IM 223,0,0
223,0,0
1-12 GETTING STARTED
Default Conditions (Continued)
Function
Equivalent
Instructions
Conditions
Digitize clear
DC;
Off
Scale
SC;
Off
Pen velocity
VS;
38.1 cm/s (15 in./s)
Label terminator
dt ran
ETX (ASCII decimal
equivalent 3)
Chord angle
—
Set to 5 degrees
Fill type
FT;
Set to type 1, bidirectional
solid fill
Fill spacing
FT;
1% of the diagonal distance
between PI and P2
Fill angle
FT;
Set to 0 degrees
Pen thickness
PT;
Set to 0.3 mm
The following plotter functions are not affected by a DF instruction:
• Locations of PI and P2
• Current pen and its position
• 90-degree rotation
• RS-232-C handshaking conventions
The Initialize Instruction, IN
DESCRIPTION
The initialize instruction, IN, returns the plotter’s
graphics conditions to the initial power-on state by program control.
This instruction has no effect on handshake protocol or the plotter’s
state (programmed on or programmed off) in an RS-232-C environment.
|!£1£| The instruction can be used to return the plotter to a known
state at the beginning of a graphics program so unwanted graphics
parameters such as character size, slant, and scaling are not inherited
from another program. PI and P2 are set to power-on positions.
SYNTAX
IN terminator
12dMLKLUi!U No parameters are required; if a parameter is supplied,
the instruction will execute and error 2 will be set.
GETTING STARTED 1-13
The initialize instruction sets the plotter to the same conditions as the
default instruction, DF, and sets these additional conditions.
• The pen is raised.
• All HP-GL errors are cleared. Bit position 3 of the output status byte
is set to true(l) indicating the plotter has been initialized. (This bit is
cleared by OS.)
• The rotation state is defaulted to 0 degrees.
• The scaling points PI and P2 are set as follows:
Default PI and P2 Scaling Points
Paper Size
PI
P2
A
250,596
10250,7796
A4
603,521
10603,7721
B
522,259
15722,10259
A3
170,602
15370,10602
The Input Mask Instruction, IM
DESCRIPTION
The input mask instruction, IM, controls the conditions
under which HP-GL error status is reported, the conditions that can
cause an HP-IB service request message, and the conditions that can
cause a positive response to an HP-IB parallel poll.
ircrei With both interface configurations (HP-IB and RS-232-C), this
instruction can be used to change the conditions under which HP-GL
error status is reported. In an HP-IB system only, the instruction is
used to enable the plotter to send a service request message when
specified bits of the status byte are set, and/or enable a positive
response to a parallel poll under the conditions specified.
SYNTAX
IM E-mask value (,S-mask value (,P-mask value))
terminator
or
IM terminator
UMJiLUilU I n the RS-232-C configuration, the S- and P-masks are of
no use and are ignored if present. The E-mask is used by both con¬
figurations.
The E-mask value specified is the sum of any combination of the bit
values shown in the following table. When an HP-GL error occurs, the
bit in the E-mask corresponding to the error number as shown on the
next page is tested to determine if the error bit (bit 5) of the status byte
1-14 GETTING STARTED
is to be set and the front panel ERROR LED is to be turned on. If a bit is
not set, there is no way to ever determine if that error occurred.
E-Mask
Bit Value
Bit
Error
Number
Meaning
1
0
1
Instruction not recognized
2
1
2
Wrong number of parameters
4
2
3
Bad parameter
8
3
4
Not used
16
4
5
Unknown character set
32
5
6
Position overflow
64
6
7
Not used
128
7
8
Vector or PD received with pinch
wheels up
The default E-mask value of 223 (128 + 64 + 16 + 8 + 4 + 2 + 1) will
specify that all errors except error 6 will set the error bit in the status
byte and turn on the ERROR LED whenever they occur. Error 6 will not
set the error bit or turn on the error LED if it occurs, since it is not
included in the E-mask value. Errors 4 and 7 never occur so setting the
E-mask to 151 will set the same conditions as the default value 223.
The S-mask value specified is the sum of any of the bit values shown
below. It determines when a service request message will be sent. When
a bit of the status byte changes value, the status byte is ANDed with
the S-mask in a bit-by-bit fashion to determine if bit 6 of the status byte
is to be set and the service request message sent. The status of bit 6
changes as plotter conditions change, and is cleared or set as required.
S-Mask
Bit Value
Status Bit
Number
Meaning
1
0
Pen down
2
1
PI or P2 changed
4
2
Digitized point available
8
3
Initialized
16
4
Ready for data; pinch wheels down
32
5
Error
64
6
Not used
128
7
Not used
For example, an S-mask value of 4 specifies that when a digitized point
is available, setting bit 2, the service request message will be sent.
Setting other bits will not send the service request message.
GETTING STARTED 1-15
The P-mask value specifies which of the status-byte conditions will
result in a logical 1 response to a parallel poll over the HP-IB interface.
P-Mask
Bit Value
Status Bit
Number
Meaning
1
0
Pen down
2
1
PI or P2 changed
4
2
Digitized point available
8
3
Initialized
16
4
Ready for data; pinch wheels down
32
5
Error
For example, a P-mask value of 48 specifies that only bits 4 and 5 (16 +
32) of the status byte can cause the plotter to respond to a parallel poll
with a logical 1 on the appropriate data line.
The plotter, when set to default values or initialized, automatically sets
the E-mask to 223, the S-mask to 0, and the P-mask to 0. An IM
instruction without parameters or with invalid parameters also sets the
masks to the values 223,0,0.
The Paper Size Instruction, PS
DESCRIPTION
The paper size instruction, PS, provides the means to
programmatically toggle between A and B, or A3 and A4 paper sizes.
|!£1£S This instruction can be used to change the paper sizes
programmatically.
SYNTAX
PS paper size terminator
EXPLANATION
This instruction performs the functions of a front-panel
paper size change. The new paper size is determined by the parameter
and the setting of the rear-panel paper size switches. A parameter in
the range of 0-3 selects either B- or A3-size paper, and a parameter in
the range of 4-127 selects either A- or A4-size paper. The PS instruction,
however, cannot switch from English to Metric size paper or vice versa.
To change from English to Metric size paper, either turn off the plotter
and reset the rear-panel paper size switches, or reset the paper size
switches and do a front-panel reset (pressing the enter and view
pushbuttons simultaneously).
If the PS instruction sets the paper size to the current size, the
instruction is ignored. If the PS instruction changes the current paper
size, a DF instruction is automatically performed. Specifying out-of¬
range parameters sets error 3 and the instruction is ignored.
1-16 GETTING STARTED
Looking Ahead
Of course you want to use your plotter to create high quality graphic
plots. Most data display plots fall into one of three broad classes: line
graphs, bar graphs, or pie charts. Chapter 8 contains sample programs
for a line graph, a bar graph, and a pie chart.
Pie charts are an effective way to show parts of a whole entity; the
slices of the pie are the component parts. The pie chart shown here has
some segments “exploded” for emphasis. To construct a pie chart, the
data is computed as a percentage of the total and each data value is
converted to the appropriate segment of a full 360-degree circle. To
create a simple pie chart, you can use the WG and EW instructions to
draw and fill segments of a circle (arcs) as shown in Chapter 8.
Additional information on drawing circles is available under the Cl
instruction, and on shading and edging the segments of pie charts,
under the WG and EW instructions in Chapter 3.
There are three types of bar graphs: simple bar graphs, stacked bar
graphs, and clustered bar graphs. The simple bar graph here shows
that sales are increasing.
Bar graphs are essentially
a collection of rectangles.
Each of these rectangles
is filled; refer to the FT,
RA, and RR instructions
in Chapter 3 to learn
how to create a filled
or hatched rectangle. A
stacked bar might be used
to show these same sales
data broken down into
sales by region. Portions
of each bar would be col¬
ored or shaded differently
to show the sales in each
region. A sample stacked
bar program is shown in
Chapter 8. Another way
of showing sales by re¬
gion would be to use a
separate bar for each re¬
gion and to “cluster” all
the bars for one year to¬
gether with a larger space
between each cluster of
bars.
SMITH UNIVERSITY
STUDENT ENROLLMENT BY COLLEGE
GETTING STARTED 1-17
Chapter
Establishing Boundaries
and Units
What \buTl Learn in This Chapter
In this chapter you will learn about the plotting area, how to define a
point in this area, and the two kinds of units used to describe the plot¬
ting area. After reading this chapter, you will be able to decide which
units to use for your data. In addition, you will be able to scale the
plotting area into user units appropriate for your data, and to set or
read the current scaling points. You will be able to restrict plotting to
only a portion of the plotting area, rotate the coordinate system, and
read the current limits of the plotting area.
HP-GL Instructions Covered
IP The Input PI and P2 Instruction
OP The Output PI and P2 Instruction
SC The Scale Instruction
IW The Input Window Instruction
OW The Output Window Instruction
OH The Output Hard-clip Limits Instruction
RO The Rotate Coordinate System Instruction
Terms You Should Understand
Scaling — dividing the plotting area into units convenient for your ap¬
plication. Units need not be the same physical size in both axes, nor
does there need to be an equal number of units in the X- and Y-axes.
Scaling Points — the points on the plotting surface moved to when the
front panel buttons Pi and P2 are pressed. These points are assigned the
user-unit values specified by the parameters of the scaling instruction
SC.
Window — that part of the plotting area in which plotting of points,
lines, and labels can occur. At power on, the window is set to the hard-
clip limits of the plotter. Nothing can be drawn outside the current
window.
Clipping — restricting plotting to a portion of the plotting area by
establishing a window of a certain size.
ESTABLISHING BOUNDARIES AND UNITS 2-1
The Plotting Area
The plotting area is that area of each size paper in which the pen can
draw. The default size of the plotting area is determined by the settings
of the us/met and A4/A3 rear-panel switches when power is first turned
on. The following table shows the combination switch settings and the
maximum plotting range for all four paper sizes.
NOTE: The plotter cannot sense the size of paper that is loaded. It is
the user’s responsibility to ensure that the paper size switches are set to
correspond with the size of paper to be used. ■
Maximum Plotting Ranges
Paper Size
Settings
Selected
Paper Size
Maximum Plotting Range
(Plotter Units)
US/MET
A4/A3
X-axis
Y-axis
US
A4
A
(8.5 X 11 in.)
0-10 365
(257.8 mm/
10.15 in.)
0-7962
(198.1 mm/
7.8 in.)
US
A3
B
(11 X 17 in.)
0-16 640
(413.9 mm/
16.3 in.)
0-10 365
(257.8 mm/
10.15 in.)
MET
A4
A4
(210 X 297 mm)
0-11 040
274.6 mm/
10.81 in.)
0-7721
(192.1 mm/
7.56 in.)
MET
A3
A3
(297 X 420 mm)
0-16 158
(401.9 mm/
15.82 in.)
0-11 040
(274.6 mm/
10.81 in.)
Regardless of its size, the plotting area should be thought of as a two-
dimensional Cartesian coordinate system. In this system, the entire
plotting area is divided (scaled) into a grid as shown in the following
illustration. Each intersection of these grid lines represents a distinct
point that is expressed by X- and Y-axis coordinates with respect to the
origin point (X = 0, Y = 0). For example, the coordinates X = 4, Y = 5
define the point at the intersection of the fourth positive grid line along
the X-axis and the fifth positive grid line along the Y-axis. These
coordinate values are used as parameters in HP-GL instructions to
move the pen to any given point in the plotting area.
2-2 ESTABLISHING BOUNDARIES AND UNITS
+32 767
-32 768
Cartesian Coordinates
The location of the coordinate system origin point and the orientation
of the X- and Y-axis with respect to A and A4 or B and A3 paper sizes
are shown in the following diagrams. Hard-clip limits and the approxi¬
mate default locations of scaling points PI and P2 are also shown. All
of these default conditions are determined by the settings of the US/MET
and A4/A3 switches when plotter power is first turned on.
The hard-clip limits determine the maximum limits of the pen’s motion
and the area within which scaling points PI and P2 can be positioned.
Except for narrow margins which are required by the grit wheel paper-
moving technology, the hard-clip limits allow plotting on the entire
paper surface.
NOTE: The power-up default input window is coincident with the hard-
clip limits. The size of the input window can be changed using the
instruction IW to programmatically limit the pen’s motion. ■
ESTABLISHING BOUNDARIES AND UNITS 2-3
J • PI (DEFAULT)
0 ,0 ORIGIN
Default Orientation of Plotter Coordinate System (A/A4 Paper)
0,0 ORIGIN
*1
PI (DEFAULT)
HARD-CLIP.
LIMITS ^ 4 ,
-► +Y
+X
(DEFAULT) P2
0 0*00
□ o □ □ a
o o a d a
oo o
t J _
Default Orientation of Plotter Coordinate System (B/A3 Paper)
2-4 ESTABLISHING BOUNDARIES AND UNITS
Unit Systems
There are two unit systems which can be used to define points in the
plotting area: plotter units and user units. Plotter units are always the
same size. The size of a user unit depends on the parameters of the SC
instruction and the settings of the scaling points, PI and P2.
The Plotter Unit
The plotting area is divided into plotter units; one plotter unit equals
0.02488 mm (0.000 98 in.). There are approximately 40.2 plotter units
per millimetre, or approximately 1021 plotter units per inch. One plotter
unit is the smallest move the plotter can make. While the pen can only
plot within the hard-clip limits, parameters of plot instructions between
—32 768 and 32 767 plotter units are understood by the plotter. When
plotting in plotter units, only integer values are used; parameters are
truncated to integers. Refer to The Plot Absolute Instruction, PA, in
Chapter 3.
User Units
The plotting area can also be scaled into user units. This is done with
the scale instruction, SC, which assigns values to the scaling points PI
and P2. A user unit may be almost any size. The parameters of the SC
instruction are truncated to integers between —32 768 and 32 767.
Parameters of plot instructions must also be in that range but may be
decimal numbers with fractional parts. Decimal fractions are not trun¬
cated; as a matter of fact, the scaling points can be set to 0,0 and 1,1
and all of the data can be decimal fractions between 0 and 1. Refer to
the plot instructions PA and PR in Chapter 3.
Setting the Scaling Points
On power-up, the default location of scaling point PI is in the lower-left
comer of A/A4 size paper or in the upper-left comer of B/A3 size paper.
In each case, the default location of scaling point P2 is in the comer
opposite from PI. The exact default coordinate locations of scaling
points PI and P2 are shown in the following table, in plotter units, for
the different paper sizes. These default coordinate values define opposite
corners of a rectangular area that is centered on the associated size of
paper. Regardless of its size, the rectangular area defined by PI and P2
will hereafter be referred to as the “P1/P2 frame.”
ESTABLISHING BOUNDARIES AND UNITS 2-5
Default Coordinate Values for Scaling Points PI and P2
Paper Size
Default Scaling Points (Plotter Units)
PlxjPly
P2 x ,P2 y
A
250,596
10 250,7796
A4
603,521
10 603,7721
B
522,259
15 722,10 259
A3
170,602
15 370,10 602
The locations of scaling points PI and P2 can be changed manually
from the front panel or programmatically with the instruction IP. Refer
to the following paragraph for the manual procedure and to the follow¬
ing section for a description of the instruction IP. The default locations
for PI and P2 can be reestablished by any of the following methods:
• power-up initialization,
• execution of either the instruction IN or the instruction IP without
parameters,
• simultaneously pressing enter and view (front-panel reset).
Setting PI and P2 Manually
P2 moves when PI is moved manually. If you want P2 to be at a
specific location, set PI first and then P2. If you want to establish an
area of a certain size onto which the parameters of a scale instruction
will be mapped, you may set P2 in the desired location relative to the
current PI, and then move PI. P2 will move to a corresponding location
so that both the X- and Y-distances between PI and P2 remain con¬
stant. If such a move means the new location of P2 will be beyond the
plotting area, either or both coordinates of P2 are set to the plotting
limits. In this case, the size of the rectangle established by PI and P2
will, of course, not remain the same. A detailed description, including
illustrations, is contained in the HP 7475 Operation and Interconnection
Manual.
To set PI or P2 manually:
1. Move the pen to the desired location using the front-panel cursor
(arrow) buttons.
2. Press enter simultaneously with pi or P2. If enter is not held down,
the pen will merely move to PI or P2 and no change in the location
of PI or P2 will occur.
3. Check the new locations of the scaling points by pressing Pi; then
press P2.
2-6 ESTABLISHING BOUNDARIES AND UNITS
The Input PI and P2 Instruction, IP
DESCRIPTION
The input PI and P2 instruction, IP, provides the
means to relocate PI and P2 through program control.
HKIM The IP instruction is often used to ensure that a plot is always
the same size, especially when the user and programmer are not the
same person. It establishes program control of plot size and label direc¬
tion. This instruction can also be used to move the scaling points Pi
and P2 from their default or current locations; to give mirror images of
vectors and labels; to change the size of a user unit, thus reducing or
enlarging an image; to change the size or direction of labels when
relative character size or direction is in effect; and to set PI and P2
back to their default locations.
SYNTAX
IP Pl x ,Ply (, P2 x ,P2 y ) terminator
or
IP terminator
EXPLANATION
The new coordinates of PI and P2 are specified in the
order shown above and must be in absolute plotter units. Parameters
should be ^ 0 and within the maximum plotting area. Specifying a
parameter outside of the maximum plotting range will set error 3 and
the instruction will be ignored. Refer to The Plotting Area paragraph,
in this chapter, for the maximum plotting ranges on each size of paper.
Specifying the coordinates of P2 is optional. However, if the coordinates
of P2 are omitted, then P2 tracks PI and its coordinates change so that
the X- and Y-distances between PI and P2 do not change.
An IP instruction without parameters sets PI and P2 to the default
coordinate values for the currently selected size of paper. Refer to
Setting the Scaling Points, in this chapter, for the default coordinate
values of PI and P2.
Upon receipt of a valid IP instruction, bit position 1 of the output status
word is set true (1).
The following HP-GL instruction relocates the scaling points PI and P2
to the positions shown in the figure.
ESTABLISHING BOUNDARIES AND UNITS 2-7
" IP3000 ,2000 ,5000,5000i
• P2
15000,5000)
• PI
(3000,2000)
The Output PI and P2 Instruction, OP
DESCRIPTION
The output PI and P2 instruction, OP, provides the
means to make the current coordinates of PI and P2 available for
output.
PBfti The instruction can be used to determine the position of PI
and P2 in plotter units. This information can be used with the input
window instruction, IW, to set the window to PI and P2 under program
control, to compute the number of plotter units per user unit when
scaling is on, or to determine the numeric coordinates of PI and P2
when they have been set manually.
mm OP terminator
EXPLANATION
After an OP instruction is received, the plotter will out¬
put the coordinates of PI and P2 in plotter units as four integers in
ASCII in the following form:
Plx,Ply,P2 x ,P2y TERM
where TERM is the output terminator for your system. See Terms You
Should Understand in Chapter 7.
The range of the integers is limited to the plotting range of the
currently selected size of paper as shown on the next page.
2-8 ESTABLISHING BOUNDARIES AND UNITS
Plotting Ranges
Paper Size
Plotting Range
X-axis
Y-axis
A
0 sS X sc 10 365
0 ^ Y ^ 7962
B
0 ^ X ^ 16 640
0 ^ Y sS 10 365
A4
0s£Xs£ 11 040
0 Y sS 7721
A3
0^X^16 158
0^ Y^ 11 040
Upon completion of output, bit position 1 of the output status byte is
cleared.
The Scale Instruction, SC
DESCRIPTION
The scale instruction, SC, establishes a user-unit coordi¬
nate system by mapping values onto the scaling points PI and P2.
This instruction is used to enable you to plot in user units con¬
venient to your application. For instance, if your X values represent
months, then X m in = 1 and X m ax = 12. If the values for Y-coordinates
all lay between 0 and 10, you might use 0 as Y m in and 10 as Y m ax. By
adjusting your minimum and maximum values, you can provide addi¬
tional room for labeling. If your plot is a 12-month bar chart with Y-
coordinates 0 to 10, you might scale the X-axis 0 to 14 so the first and
last bars are not at the edge of the graph, and scale the Y-axis 0 to 12
leaving room for a title at the top.
SYNTAX
SC Xmin,Xmax,Ymin,Ymax terminator
or
SC terminator
EXPLANATION
Executing an SC instruction without parameters (SC;)
turns scaling off and subsequent parameters of plot instructions are
interpreted as plotter units.
When parameters are used, all four parameters are required. Decimal
parameters in an SC instruction are truncated to integers. The param¬
eters Xmin and Ymin define the user-unit coordinates of PI, and the
parameters Xmax and Ymax define the user-unit coordinates of P2. PI
and P2 may be any two opposite corners of a rectangle. Scaling points
PI and P2 retain the assigned user-unit coordinate values until scaling
is turned off or another SC instruction redefines their user-unit coor¬
dinate values. Therefore, the physical size of a user unit will change
when any change is made in the relative position and distance between
PI and P2.
ESTABLISHING BOUNDARIES AND UNITS 2-9
Specifying X m ax = X m in or Y ma x = Y m in will turn off scaling. Specifying
parameters less than —32 768 or greater than 32 767 sets error 3 and
causes the instruction to be ignored. If more than four parameters are
specified, the instruction is executed with the first four parameters, error
2 is set, and the rest of the parameters are ignored.
The user-unit coordinate system that is mapped onto the plotter unit
coordinate system by the SC instruction is not limited to the rectangle
defined by Pi and P2; it extends over the entire plotting area. When
user-unit scaling has been established by executing an SC instruction
with parameters, decimal parameters of plot instructions are not trun¬
cated; the point 3.5,7.5 is distinct from the point 3.6,7.8. This is
different from some other HP plotters and makes plotting of noninteger
data much simpler.
It is not possible to scale an area such that PI or P2 are assigned
values larger than 32 767 or less than —32 768. To plot data with values
beyond these limits, reduce your data to acceptable ranges by an
arithmetic process before sending it to the plotter. This can be accom¬
plished by dividing the data by some factor of 10 so that the integer
portions fall between ±32 767.
The illustrations which follow show the coordinate grids mapped onto
the plotting area as a result of executing the indicated instructions
when A size paper is selected. In all cases, the points labeled at each
comer are just outside of the plotting area. If a PA instruction with
these parameters is sent to a plotter with the indicated scaling and
A size paper, the pen will move to the comer and lift, indicating the
point is outside the plotting area.
"IP; SC 0,10,0,10;"
P2 10,10'
10.12,10.23
PI 0,0 USER UNITS
I_l_I_L.
-0,26,-0.82
2-10 ESTABLISHING BOUNDARIES AND UNITS
IP 0,0,1000,1000) SC 0,10,0,10;
0,79.7
9
• P2 1000,1000 PLOTTER UNITS
PI 0.0 USER UNITS AND PLOTTER UNITS
103.7,79.7
USER
UNITS
103.7 ,0
This example scales a square plotting area from 0 to 1 in each axis and
draws a unit circle. Change line 10 as necessary for your computer.
Line 80 is necessary to limit the number of digits in the X- and Y-
coordinates. This prevents the possibility of coordinates being sent to
the plotter in scientific notation, which sets an error in the plotter.
10 OPEN "C0M1:9600 ,N ,8,1 ,RS.CS65535 ,DS ,CD“ AS #1
20 PRINT #1, “IN; IP4000,3000,5000,4000;'*
30 PRINT *1 , “SP1;SC0,1 ,0,1;“
40 PI=3.1416
50 FOR T=0 TO 2*PI + PI/20 STEP PI/20
60 X=C0S(T)
70 Y-SIN(T)
80 PRINT #1 .USING “&+#.####+#.####&";“PA" ,X ,Y ,“PD;“
100 NEXT T
1 10 PRINT #1 , "PU;SP0;“
120 END
ESTABLISHING BOUNDARIES AND UNITS 2-11
The Input Window Instruction, IW
DESCRIPTION
The input window instruction, IW, provides the means
to restrict programmed pen motion to a rectangular area of the plotting
surface. This area is called the “window.”
lima The instruction can be used to restrict plotting to a certain
area of the paper. The instruction is especially useful when your data
should fall in a certain range but your scaling is larger (perhaps you
have left room for labels) and you don’t want lines outside the normal
data area.
SYNTAX
IW Xlower left,Ylower left,Xupper right ,Yupper right terminator
or
IW terminator
Parameters are always interpreted as plotter units.
When four parameters are included, the window is set according to the
parameters. If no parameters are included, the window is set to the
maximum plotting area of the currently selected size of paper.
The four parameters specify, in absolute plotter units, the X- and
Y-coordinates of the lower-left and upper-right corners of the window *
area. The parameters should be positive and less than 10 365, 16 640,
11 040, or 16 158 for X (depending on the currently selected paper size)
and less than 7962, 10 365, 7721, and 11 040 for Y. Parameters between
-32 768 and 0 are set to 0. Parameters larger than the limits of the
absolute plotting area but less than 32 767 are set to the above-
mentioned limits for X and Y. If X- or Y-parameters of the lower-
left corner are specified to be greater than the X- or Y-parameters of
the upper-right corner, the parameters will be automatically inter¬
changed. For example, IW6000,3000,5000,4000 will be converted to
IW5000,3000,6000,4000.
2-12 ESTABLISHING BOUNDARIES AND UNITS
At power on, after a front-panel reset, or when an IN or DF instruction
is executed, the window is automatically set to the current hard-clip
limits, i.e., maximum plotting area.
The Output Window Instruction, OW
DESCRIPTION
The output window instruction, OW, provides the
means to obtain the X- and Y-coordinates of the lower-left and upper-
right corners of the window area in which plotting can currently occur.
HKIM The instruction can be used to determine the area in which
any plotting will occur.
HiJlilJ OW terminator
iBJilTjuMIBIkB No parameters are used. Output is in plotter units.
After an OW instruction is received, the plotter will output the coordi¬
nates of opposite corners of the plotting area in plotter units as four
integers in ASCII in the following form:
Xlower left, Ylower left, Xupper right, Yupper right TERM
where TERM is the output terminator for your system. See Terms You
Should Understand in Chapter 7.
The range of the integers is limited to the plotting range of the
currently selected size of paper as follows:
Plotting Ranges
Paper Size
Plotting Range
X-axis
Y-axis
A
0 ss X < 10 365
0 sS Y < 7962
B
0 < X ^ 16 640
0 ^ Y 10 365
A4
0^ 11 040
0 Y «£ 7721
A3
0 sS X < 16 158
0^ 11 040
The Output Hard-clip Limits
Instruction, OH
DESCRIPTION
The output hard-clip limits instruction, OH, is used to
output the lower-left (LL) and upper-right (UR) coordinates of the
current hard-clip limits.
Imj This instruction can be used with the IP instruction to deter¬
mine and make use of the maximum available plotting area.
ESTABLISHING BOUNDARIES AND UNITS 2-13
SYNTAX
OH terminator
EXPLANATION
After an OH instruction is received, the plotter will
output the LL and UR coordinates in plotter units as four ASCII
integers in the following form:
Xlower left,Ylower left,Xupper right, Yupper right, TERM
where TERM is the output terminator for your system. See Terms You
Should Understand in Chapter 7.
The plotter suppresses leading zeros and positive signs. The Input Pi
and P2 Instruction, IP, can be used to relocate PI and P2 to the
maximum plotting area as determined by the OH instruction. Refer to
Chapter 2 for additional information on the IP instruction. Use of an
IW instruction (soft clipping) does not affect the output from the OH
instruction. Changing the paper size, however, will change the hard-
clip limits. The 90-degree rotation function will change the UR coordi¬
nate values. Thus, if the absolute Y-axis value is larger than the
absolute X-axis value, you know that the coordinate axes are rotated
from their default orientation.
The Rotate Coordinate System
Instruction, RO
DESCRIPTION
The rotate coordinate system instruction, RO, pro¬
grammatically rotates the plotter unit/user-unit coordinate systems
90 degrees.
UKiM This instruction is used to orient plots vertically or horizon¬
tally, regardless of whether the paper is loaded with the short or long
dimension along the pen-axis.
SYNTAX
RO (angle in degrees) terminator
or
RO terminator
EXPLANATION
The only allowable parameters are 0 and 90. The
instruction RO90; rotates the current coordinate system 90 degrees
from its default orientation as shown in the following diagrams for
A/A4 and B/A3 paper sizes. Rotations are not cumulative, and the
rotate function can only be toggled on and off. The instruction ROO; is
the same as RO; and turns off the rotate function.
When an RO90; instruction is executed, PI and P2 retain their current
coordinate values and may therefore be rotated outside the hard-clip
limits. The current input window is also rotated, and any portion that
is rotated outside of the hard-clip limits is clipped to the hard-clip
2-14 ESTABLISHING BOUNDARIES AND UNITS
limits. The size of the clipped input window can be determined by
executing the OW instruction. The input window can be expanded to
the hard-clip limits and PI and P2 can be defaulted to their rotated
default coordinate values using the instructions IW and IP without
parameters.
Rotated Default Coordinate Values for Scaling Points PI and P2
Paper Size
Rotated Default Scaling Points (Plotter Units)
Plx.Ply
P2x,P2y
A
154,244
7354,10 244
A4
0,610
7200,10 610
B
283,934
10 283,16 134
A3
607,797
10 607,15 997
The 0,0 origin point moves when the coordinate system is rotated, but
the physical size and location of the hard-clip limits are not affected.
However, the defined lower-left (LL) and upper-right (UR) corners of the
hard-clip limits are rotated to maintain the same relationship with
respect to the 0,0 origin point. The coordinate values for UR are
determined by paper size and the state of the rotate function; but the
coordinate values for LL will always be 0,0 regardless of paper size and
the state of the rotate function. The current plotter unit coordinate
values for LL and UR can be obtained by executing the OH instruction.
When the coordinate system is rotated, the logical pen position is
changed to correspond with the current physical pen position. The
coordinate values of the new logical pen position can be obtained by
executing either an OA or OC instruction after the rotate instruction is
executed.
Specifying parameters other than 0 or 90 sets error 3 and the instruction
is ignored. If you specify too many parameters, the instruction is
executed with the first parameter, error 2 is set, and the rest of the
parameters are ignored.
You can also turn rotation on and off via the front panel. Press the
enter and fast buttons simultaneously to turn on rotation; press again
to turn it off. Unlike the RO instruction, the front-panel rotation
automatically defaults the input window and the P1/P2 frame. You can
also determine the state of the rotate function using the OH and OS
instructions. Refer to the OH instruction in this chapter and the OS
instruction in Chapter 7 for details.
The initialize instruction, IN, defaults the rotation state to 0 degrees.
ESTABLISHING BOUNDARIES AND UNITS 2-15
DEFAULT ORIENTATION
UR
ROTATED 90° ROTATED 90°
WITH DEFAULT
WINDOW AND
P1/P2 FRAME
Rotation on A/A4 Size Paper
2-16 ESTABLISHING BOUNDARIES AND UNITS
DEFAULT ORIENTATION
LL (0,0 ORIGIN)
P1/P2 FRAME
Rotation on B/A3 Size Paper
ESTABLISHING BOUNDARIES AND UNITS 2-17
Chapter
Controlling the Pen
and Plotting
What You’ll Learn in This Chapter
Now that you understand the unit systems in which data can be repre¬
sented, you are ready to create plots. In this chapter, you will learn how
to select or change pens, how to set and change pen velocity, how to
raise and lower the pen, and how to plot. You will learn how to plot to
absolute X,Y coordinates or to plot relative to the last pen position. You
will also learn how to send variables as parameters of plot instructions;
this will enable you to write general purpose graphics programs. Finally,
you will learn how to define and fill rectangles and arc segments.
HP-GL Instructions Covered
SP The Select Pen Instruction
VS The Velocity Select Instruction
PU/PD The Pen Up/Down Instructions
PA The Plot Absolute Instruction
PR The Plot Relative Instruction
Cl The Circle Instruction
AA The Arc Absolute Instruction
AR The Arc Relative Instruction
FT The Fill Type Instruction
PT The Pen Thickness Instruction
RA The Shade Rectangle Absolute Instruction
EA The Edge Rectangle Absolute Instruction
RR The Shade Rectangle Relative Instruction
ER The Edge Rectangle Relative Instruction
WG The Shade Wedge Instruction
EW The Edge Wedge Instruction
Terms You Should Understand
Absolute Plotting — plotting to a point whose location is specified
relative to the origin (0,0). When the PA instruction is used to plot to a
point, the pen always moves to the same point on the plotting surface,
no matter where the pen was before the move.
Relative Plotting — plotting to a point whose location is specified
relative to the current pen position. The point moved to then becomes
CONTROLLING THE PEN AND PLOTTING 3-1
the effective origin for the next parameter of a plot relative instruction.
When the PR instruction is used to plot to a point, the destination of the
pen depends on where the pen was when the instruction was received.
Plotter Unit Equivalent — the X,Y coordinates of a point, given in user
units, if they were expressed in plotter units.
The Pen Instructions, PU and PD
DESCRIPTION
The pen up instruction, PU, and the pen down instruc¬
tion, PD, raise and lower the pen.
lIKlM The instructions are used to raise and lower the pen during
plotting. They may be used with parameters to plot or move to the
points specified by the parameters.
SYNTAX
PU terminator
or
PD terminator
and
PU X,Y(, . . .) terminator
or
PD X,Y(, . . .) terminator
EXPLANATION
When no parameters are included, the pen up instruc¬
tion, PU, raises the pen without moving it to a new location. The pen
down instruction, PD, lowers the pen without moving it to a new
location, if the pen is within the window. If parameters are included,
the pen will move, in order, to the X,Y coordinates specified. The coor¬
dinates are interpreted as plotter units if scaling is off and user units if
scaling is on. Moves are either relative or absolute, depending on
whether a PA or PR was the last plot instruction executed.
If parameters are included, both coordinates of an X,Y coordinate pair
must be given. An odd number of parameters will set an error condi¬
tion, but all X,Y pairs which precede the unmatched parameter will be
plotted. For a description of the PU and PD instructions with parameters,
refer to The Plot Absolute Instruction, PA, and The Plot Relative
Instruction, PR, which follow.
NOTE: The plotter has an automatic pen lift feature which will lift the
pen after it has been in the pen-down state for 55 seconds and no pen-
down plot instructions or label instructions have been sent to the plot¬
ter or no front-panel pen-down moves have been made for 55 seconds. ■
3-2 CONTROLLING THE PEN AND PLOTTING
The Select Pen Instruction, SP
DESCRIPTION
The select pen instruction, SP, selects and/or stores a
pen.
HHti The instruction is used to load a pen into the pen holder so
that drawing will occur. It can be used to select a pen of a different
color or width, during the plotting program. It can be used with a zero
parameter or no parameter to store the pen currently in the pen holder
into its stall at the end of a program.
SYNTAX
SP pen number terminator
or
SP terminator
EXPLANATION
The pen parameter must be in the range of 0 < — n < — 6.
Decimal fractions are truncated. A zero parameter or no parameter
stores the pen unless the pen carousel is full. If the pen carousel is full,
the plotter will try to put the pen away in the appropriate stall. If the
stall is occupied, the plotter will attempt to store the pen in pen stalls 1
through 6 in order. If all the stalls are full, the pen holder will return to
its previous location. When a pen parameter is out of range, the parame¬
ter is ignored and the pen does not change. If the pen designated for
selection is not in its stall, the plotter will attempt to select a pen
beginning in stall 1 and continuing through stall 6 until a pen is found.
The Velocity Select Instruction, VS
DESCRIPTION
The velocity select instruction, VS, specifies the pen-
down speed for plotting and labeling operations.
IIHtl The instruction is used to set velocity to a speed other than the
default velocity of 38.1 cm/s and to change the acceleration from its
default value of 2 g (980 cm/s 2 ). This instruction should be used to slow
velocity to 10 cm/s when plotting on transparency film. A slightly
thicker line can be created by slowing down the pen speed on any
medium. A pen nearing the end of its life will write with a clearer,
sharper, more solid line if the velocity is slowed.
SYNTAX
VS pen velocity terminator
or
VS terminator
EXPLANATION
A VS instruction without parameters sets pen velocity
to its default velocity of 38.1 cm/s (15 in./s) and acceleration to 2 g
(980 cm/s 2 ). A VS instruction with parameters sets the pen velocity for
horizontal or vertical pen-down moves to the value specified by the
first parameter and slows the acceleration to 0.5 g. Anything after the
first parameter is ignored. Parameters must be in the range 0 to
CONTROLLING THE PEN AND PLOTTING 3-3
127.9999. A velocity of 0 is set to 0.38 cm/s. Velocity can be set in
increments of 0.38 cm/s. Parameters are rounded to the nearest multiple
of 0.38 cm/s. Negative parameters and parameters greater than or
equal to 128 set an error condition (error 3) and the velocity does not
change. Parameters between 38.1 and 127.9999 set velocity to its default
value of 38.1 cm/s.
When either the horizontal or vertical velocity falls in the range 0.38 to
3.8 cm/s, it is reset to a slower or faster velocity to avoid this range.
This is done to assure lines of high quality. The change is most notice¬
able when a line is almost vertical or almost horizontal. Pen-down
moves will be at the specified velocity except when such adjustment is
necessary.
Execution of a VS instruction with a parameter of 38.1 will slow the
acceleration, giving the highest line quality at that maximum speed.
A default instruction, DF, or an initialize instruction, IN, will also reset
the velocity and acceleration to the values 38.1 cm/s and 2 g.
The Plot Absolute Instruction, PA
DESCRIPTION
The plot absolute instruction, PA, moves the pen to the
point(s) specified by the X- and Y-coordinate parameters.
Itfivl The instruction can be used together with PD to draw lines or
with PU to move the pen to a specific point on the plot. The instruction
can be executed without parameters to establish absolute plotting, as
opposed to relative plotting for PU or PD instructions with parameters.
In this case, the parameters of PU and PD are interpreted as absolute
X,Y coordinates until any PR instruction is received.
SYNTAX
PA
Xi coordinate,Yi coordinate (,X2 coordinate,
Y 2 coordinate, . . . ,X n coordinate, Y n coordinate)
terminator
or
PA terminator
EXPLANATION
Recommended parameters are decimal numbers be¬
tween -32 768.0000 and 32 767.9999. When scaling is off, parameters
are truncated to integers as follows:
• For positive numbers, the fractional portion is ignored and the in¬
teger portion remains unchanged. For example, both 1234.4 and
1234.9 become 1234.
• For negative numbers, the fractional portion is ignored and the in¬
teger portion is changed to the next negative integer. For example,
both -1234.4 and -1234.9 become -1235. Since you cannot plot to
negative values unless scaling is on, (in which case decimal portions
3-4 CONTROLLING THE PEN AND PLOTTING
of parameters are used), the only time you will observe this is when
you use the output commanded position and pen status instruction,
OC, and the last X- and/or Y-parameter sent was negative. This is
because the OC instruction will return the decimal portion when
scaling is in effect.
When scaling is on, any fractional portion of a parameter is used.
A PA instruction without parameters sets absolute plotting mode for
PU and PD instructions with parameters.
When parameters are included with a PA instruction, both coordinates
of an X,Y coordinate pair must be given. An odd number of parameters
will set an error condition but all X,Y pairs which precede the un¬
matched parameter will be plotted.
The X-coordinate specifies, in either plotter units or user units, the
absolute X-location to which the pen will move. The Y-coordinate speci¬
fies, in either plotter units or user units, the absolute Y-location to
which the pen will move. If scaling is on, coordinates are in user units.
If scaling is off, coordinates are in plotter units.
The mnemonics PU and PD can be included ahead of, between, or after
X,Y coordinate pairs. PU lifts the pen; PD lowers the pen.
Any number of coordinate pairs, as well as PU or PD mnemonics, can
be listed after a PA instruction. (This is limited only by the ability of
the controller to output without a line feed character which is an instruc¬
tion terminator.) The pen will move to each point in the order given.
Commas, spaces, or a sign are required between numeric parameters
and are optional after two-letter mnemonics. The last entry is followed
by the terminator. In the following examples, commas are used to show
optional and required separators. Optional commas or spaces which
can be used between each letter of the mnemonics are not shown. The
semicolon is used to indicate the terminator.
PA,PD,Xi,Yi,PU,X2,Y2,PD,X 3 ,Y 3 ,;
I-1-1-1-1-1-1-OPTIONAL
PU,Xi,Yi,PD,X 2 ,Y2,X 3 ,Y 3 ,PU;
I-1-1-1-OPTIONAL
PD,Xi,Yi,X 2 ,Y 2 ,X 3 ,Y 3 ,;
L-1-OPTIONAL
CONTROLLING THE PEN AND PLOTTING 3-5
If no pen control parameter is given, the pen will assume the pen state
(up or down) of the previous statement. The PU or PD mnemonics can
also be substituted for the PA (or PR) mnemonic. This is equivalent to
having PU; or PD; preceding the PA or PR instruction. Therefore, PU
and PD with parameters are interpreted to be in place of PA or PR,
depending upon which mnemonic, PA or PR, was last specified.
PA is specified by any of the following:
• power-up or front-panel reset,
• execution of an IN instruction,
• execution of a DF instruction, or
• execution of a PA instruction with or without parameters.
The pen moves and draws lines only within the currently defined
window. Refer to The Input Window Instruction, IW, in Chapter 1.
The plotter ignores parameters which are out of range, does not change
the pen state, and sets error 3 (parameter out of range). When scaling is
off, in-range parameters are greater than or equal to -32 768 and less
than or equal to 32 767. When scaling is on, both the parameters and
their plotter unit equivalent must also be in that same range. To find
the plotter unit equivalent, use the equations in the section Scaling
Without Using the SC Instruction in Appendix C.
There are four types of vectors that can be drawn with a PA instruction
from a given last point to some new point.
LAST POINT
NEW POINT
1 .
inside window area
to
inside window area
2.
inside window area
to
outside window area
3.
outside window area
to
inside window area
4.
outside window area
to
outside window area
In type one, the pen moves from the last point to the new point with the
pen up or down as programmed.
In type two, the pen moves from the last point toward the new point
and stops where the line between the two points intersects the current
window. The pen up/down condition is as programmed until the inter¬
section is reached. Then, the pen is raised.
In type three, the pen moves with the pen up, to the point where the
straight line between the last and new point intersects the window limit.
When the pen reaches this point, the pen assumes its programmed (up
or down) position. The pen then moves to the new point.
In type four, no pen movement occurs unless the straight line between
the last and new point intersects the window. The X- and Y-coordinates
3-6 CONTROLLING THE PEN AND PLOTTING
of the current pen position are updated. If part of the vector is in the
window area, the pen moves, pen up, to the point where the line be¬
tween the last and the new point first intersects the window limit. The
pen moves under programmed pen up/down control to the intersection
of the vector and the other window limit. At this point, the pen stops
and lifts.
Since out-of-range points are ignored, the plotter will draw a line be¬
tween the two points on either side of discarded points. You can be sure
all lines on your plot represent actual data if you:
1. have not changed the error mask from its default setting;
2. have not executed an output error instruction; and
3. the error light is not on at the end of your plot.
(The fact that the error light is on does not necessarily mean out-of-
range data has been encountered; for example, an error in any HP-GL
instruction will turn the light on.)
The following strings of HP-GL instructions, if sent to the plotter using
a suitable output statement such as PRINT#, will draw two triangles
and then move to the point 10 365,7721 with the pen up.
“INiSPIiPA2000,1500)"
"PDS00,1500,2000,3500,2000,1500;“
“PU2500,1500;“
"PD4000,1500,2500,3500,2500,1500; “
H PU103E5 ,7721 ;"
2000,3500 2500,3500
The next strings of HP-GL instructions scale the plotting area into user
units 0 to 100 in each axis and again draws two triangles. Use an out¬
put statement implemented on your computer to send the strings to the
plotter.
CONTROLLING THE PEN AND PLOTTING 3-7
#1 , "INsSPI5SC0,100,0,100!"
ft 1 , “PA20,15;PD5,15,20,35,20,15;“
#1 , "PU25,15;PD40, 15 ,25 ,35 ,25,15;PUs
The Plot Relative Instruction, PR
DESCRIPTION
The plot relative instruction, PR, moves the pen rela¬
tive to its current location by the number of units specified by the X-
and Y-increment parameters.
11mM The plot relative instruction can be used like a PA instruction
to draw lines and move to a point. However, with PR, pen movement is
relative to the current pen position. The instruction can be executed
without parameters to establish relative plotting as opposed to absolute
plotting for PU or PD instructions with parameters. It is often used to
draw multiple occurrences of some figure on a plot, for example, to
draw several rectangles of the same size.
SYNTAX
PR Xi increment, Yi increment^X 2 increment,
Y 2 increment, . . . , X n increment, Y n increment)
terminator
or
PR terminator
EXPLANATION
Recommended parameters are in decimal numbers be¬
tween -32 768.0000 and 32 767.9999. Their plotter unit equivalents
should also be in the same range. When scaling is off, parameters are
truncated to integers in the manner described under the plot absolute
instruction. When scaling is on, any fractional portion of a parameter
is used.
A PR instruction requires that both increments of an X,Y pair be given.
An odd number of parameters will set an error condition but all X,Y
pairs which precede the unmatched parameter will be plotted.
The X-increment specifies, in either plotter units or user units, the
number of units the pen will move in the direction of the X-axis. The
Y-increment specifies, in either plotter units or user units, the number
3-8 CONTROLLING THE PEN AND PLOTTING
of units the pen will move in the direction of the Y-axis. The sign of the
parameter determines the direction of movement; a positive value
moves the pen in the positive direction and a negative value moves the
pen in the negative direction. If scaling is on, both parameters are inter¬
preted as user units. If scaling is off, both parameters are interpreted as
plotter units.
The mnemonics PU and PD can be included ahead of, between, or after
X,Y increment pairs. PU lifts the pen; PD lowers the pen. Any number
of increment pairs, as well as PU or PD mnemonics, (limited only by
the ability of the controller to output without a line feed character) can
be listed after the PR instruction. The placement of optional or required
separators and the terminator is the same as for the PA instruction.
If no pen control parameter is given, the pen will assume the pen state
(up or down) of the previous statement. The PU or PD mnemonics can
also be substituted for the PR (or PA) mnemonic. This is equivalent to
having PU; or PD; preceding the PR or PA instruction. Since the power-
on default is absolute plotting mode, a PR instruction must be executed
before parameters of PD or PU instructions will be interpreted as X,Y
increments. Relative plotting mode is cancelled by execution of a PA,
IN, or DF instruction.
The pen moves and draws lines only within the currently defined
window. Refer to The Input Window Instruction, IW, Chapter 1. Draw¬
ing of vectors in relation to the window is as described under the PA
instruction.
The plotter ignores parameters which are out of range or whose plotter
unit equivalent would be out of range if the indicated move were made.
Error 3 is set (out-of-range parameter).
When scaling is off, in-range parameters are between -32 768 and
32 767. When scaling is on, in-range parameters and their plotter unit
equivalent must be between -32 768.0000 and 32 767.9999. To find
plotter unit equivalents, refer to the section Converting from User
Units to Plotter Units in Appendix C.
The following strings of HP-GL instructions, when sent to the plotter
using your computer’s output statements, cause triangles to be drawn
that are identical to the ones previously drawn using only the PA in¬
struction. The numbers in parentheses on the plot are the X,Y incre¬
ments of the PR instructions. The numbers without parentheses are the
plotter unit coordinates of the vertices.
CONTROLLING THE PEN AND PLOTTING 3-9
"IN;SP1;PA2000,1500;"
"PR;PD-1500,0,1500,2000 ,0 ,-2000;"
“PU500,0; “
“PD 1500,0,-1500,2000,0,-2000;PU;“
(PR 1500,2000)
(PA 2000,1500)
and end
(PR 0,-2000)
(PR-1500,2000)
and end
(PR 0,-2000)
Plotting with Variables
For some plotting applications, you may want to substitute variables
for numeric parameters in an HP-GL instruction. This is simple to do.
Just remember these principles:
• The values of all parameters have the same restrictions (integer or
decimal in a valid range) when sent as variables as they do when
sent as constants.
• HP-GL mnemonics, their separators, and their terminators all must
be sent to the plotter along with the variable parameters.
NOTE: The methods used to send HP-GL instructions to the plotter
vary from computer to computer. Those discussed here are specific to
the HP Series 80 computer. However, the principles apply to any
computer. ■
How to Send Variable Parameters
The usual way to send an HP-GL instruction with numeric parameters
is to send the mnemonic, parameters, separators, and terminator as a
literal string. However, the plotter will record an error if you send
variable paramaters within a literal string.
The best way to send variable parameters is to send only the mnemonic
and terminator as literal strings, and send the parameters between
3-10 CONTROLLING THE PEN AND PLOTTING
them. The following instructions demonstrate this method and show
the characters as they are received by the plotter. (Assume that the
program defines the variables as X = 80 and Y = 90.)
1. Instructions sent: PRINT "PA" , 1 0 ,20 ,X ,Y ,";"
Plotter receives:
PA 10 20 80 90' 5
2. Instructions sent: PRINT "PA H ; 10;20; X; Y;"»"
Plotter receives: PA10 20 80 90;
Instructions 1 and 2 are similar except for the use of commas versus
semicolons between the parameters. Using a comma often means that
unnecessary blank spaces are sent. A semicolon separator sends only
leading and trailing blanks between the parameters. The semicolon
uses the interface bus most efficiently. Refer to the program in Chapter
8 to see how variables are sent.
The Circle Instruction, Cl
DESCRIPTION
The circle instruction, Cl, provides the means to draw a
circle of a specified radius and chord angle.
The instruction can be used to generate circles with a single
instruction. All computations are internal to the plotter to reduce com¬
puter overhead.
Cl radius (, chord angle) terminator
SYNTAX
90°
EXPLANATION
The radius parameter can be a positive or negative
number in integer or scaled decimal format. Its sign defines the starting
point of the circle: a circle with a positive radius starts at the 0-degree
CONTROLLING THE PEN AND PLOTTING 3-11
point; a circle with a negative radius starts at the 180-degree point. The ___
current pen position is the center of the circle. If scaling is off, the
radius is in plotter units. If scaling is on, the radius is in user units. If
user units are not the same size in the X- and Y-directions, ellipses will _
be drawn.
The chord angle parameter is in integer format and governs the
smoothness of the circle. It is interpreted as degrees and sets the
maximum angle subtended by a chord that is drawn to represent an
arc segment of the circle, as shown below. The actual angle used may
be changed by the plotter so that all chords are the same length. The —
sign of the parameter is ignored, except to set the maximum in-range
limit to -32 768 or +32 767.
The most useful chord angle values range from 0 to 180; where 0
produces the smoothest circle and larger numbers progressively reduce
the number of chords used. Values from 180 to 360 work just the ””
opposite; i.e., larger numbers progressively increase the number of
chords used and 360 produces the smoothest circle. This pattern follows
modulo 360 through the permitted range of —32 768 to +32 767. Specify-
ing out-of-range parameters sets error 3 and the instruction is ignored.
The following strings of HP-GL instructions, when sent to the plotter __
using your computer’s output statments, show the effect of different
chord angles.
"INiSPI;IP3650,2325,6650,5325; “
"SC-I 00, I 00,-100,100;''
"PA-50,40;CI30,45;“ _
"PA50,40;CI30 ,30 ; "
"PA-50,-40;CI30,15;“
"PA50,-40;CI30 ,5; " _
"SP0;"
3-12 CONTROLLING THE PEN AND PLOTTING
45 degree
30 degree
The circle instruction includes an automatic pen down feature. When a
circle instruction is received, the pen lifts (if it was down), moves from
the center of the circle to the circle starting point on the circumference,
lowers the pen, draws the circle, then returns, pen up, to the center of
the circle. After drawing the circle, the pen assumes the pen state (up or
down) that was in effect prior to the circle instruction. To avoid
drawing lines to the center of the circle, move to and away from the
circle’s center with the pen up.
Circles are drawn within the defined window, with clipping occurring
outside the window limits. Drawing circles within the window conforms
to the definitions given for plotting under the PA instruction.
Each chord of the circle is drawn using the currently defined line type.
Refer to The Line Type Instruction, LT, in Chapter 4.
To demonstrate some of the features of the circle instruction, the follow¬
ing strings of HP-GL instructions draw various circles with different
line types, radii, and starting points.
"IN;SP1;IP2G50,1325 ,7650 ,6325;"
"SC-100,100,-100,100;"
“PA0,0;LT;CI10,5;LT0;CI-20,5;LT1;CI30,5; "
“LT2;CI-40,5;LT3;CI50,5;LT4;CI-60,5;LT5;“
“CI70,5;LT6;CI80,5;"
"SP0;"
CONTROLLING THE PEN AND PLOTTING 3-13
The following BASIC program shows that the circle instruction can
also be used to define a series of circles that must be repeated in a
particular pattern.
10 OPEN "C0M1:9G00 ,N ,8,1 ,RS ,CS65535 ,DS ,CD" AS #1
20 PRINT #1 , "IN;SP1;IP3G50,2325 ,6650,5325;"
30 PRINT #1, “SC-1000,1000,-1000,1000;“
40 PRINT #1 , “PA-800,800;"
50 60SUB 130
80 PRINT #1 , "PA200,800;“
70 GOSUB 130
80 PRINT #1, “PA-800 ,-200;"
90 GOSUB 130
100 PRINT #1, “PA200 ,-200; “
110 GOSUB 130
120 END
130 PRINT #1, “CI50;PRS00,0;CI50;PR-300,-300;CI250;“
140 PRINT #1, "PR-300,-300;CI50;PRB00,0;CI50;“
150 RETURN
10 configuration statement; change this statement as nec¬
essary for your computer.
20, 30 define the plotting area and perform user-unit scaling.
3-14 CONTROLLING THE PEN AND PLOTTING
40
moves the pen to point (—800,800) to locate the starting
point of the first pattern.
130, 140 contain the subroutine necessary to draw the pattern.
First, a 50-unit radius circle is drawn, followed by a
relative move of 600 units in the X-direction where
another 50-unit radius circle is drawn. A move of —300
units in X and —300 units in Y locates the center of the
250-unit circle. The last two 50-unit circles are drawn
with the moves shown in the listing.
60, 80, and 100 locate the starting points of the other three patterns.
Start
PA (-800,800)
°r
O
PA (200,800)
o
)
o
PA (-800,-200)
°r
o
PA (200,-200)
°r
o
)
o
4
The Arc Absolute Instruction, AA
DESCRIPTION
The arc absolute instruction, AA, provides the means to
draw an arc with the center point located at a specified absolute point.
The arc can be drawn clockwise (CW) or counterclockwise (CCW),
subtends the specified arc angle, and conforms to the specified or
default chord angle.
The instruction can be used to draw an arc of any radius,
length, and smoothness with a single instruction. The arc is drawn
from the current pen position, and its center point is located by
absolute X,Y coordinates.
CONTROLLING THE PEN AND PLOTTING 3-15
SYNTAX
A A X-coordinate, Y-coordinate, arc angle (, chord angle)
AA terminator
CURRENT PEN
POSITION
ABSOLUTE X, Y
COORDINATES (ARC CENTER)
CHORD
ANGLE
ABSOLUTE X, Y
COORDINATES
(ARC CENTER)
ARC /
CH
A N vj i_ i—
CURRENT
PEN
POSITION
| | The A A instruction requires that both X- and Y-
coordinates be specified (coordinate pair) in either integer or scaled
decimal format. They are interpreted as plotter units if scaling is off or
as user units if scaling is on. The X- and Y-coordinates locate the center
of the arc and may be located on or off the plotting surface. The current
pen position is the starting point of the arc.
The arc angle is in integer format. It is the angle, in degrees, through
which the arc is drawn: a positive arc angle draws CCW from the
current pen position; a negative arc angle draws CW from the current
pen position.
The chord angle parameter is in integer format and governs the
smoothness of the arc in the same way as defined under the circle
instruction, CL The sign of the parameter is ignored, except to set the
maximum in-range limit to —32 768 or +32 767. The default chord angle
is 5 degrees. If you specify a chord length that does not divide the
sweep angle into integers, the plotter will compute the chord length up
to the nearest integer. Chords are kept the same length.
Unlike circles, arcs are drawn using the previously commanded pen
state (up or down) and line type. If no pen state has been commanded
since initialization, pen up is assumed. If no line type has been
commanded, a solid line is drawn.
Arcs are drawn within the defined window, with clipping occurring
outside the window limits. Drawing arcs within the window conforms
to the definitions given for plotting under the PA instruction.
All parameters must be in range. Specifying out-of-range parameters
sets error 3 and the instruction is ignored.
3-16 CONTROLLING THE PEN AND PLOTTING
The following BASIC program demonstrates the use of the AA
instruction.
10
20
30
40
50
60
70
80
90
OPEN "
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
PRINT
100 PRINT
110 END
C0M1:9600,N,8,1 ,RS .CS65535,DS,CD“ AS #1
#1 , "INsSPI;IP3650,2325,6650,5325;"
#1 , “SCO,100,0,100; "
#1 , "PA0,20;"
#1 , “PD;PA0 ,40;AA0,50,180;PA0,80;”
#1 , ”AA0,100,90;PA40,100;AA50,100,180;“
#1 , "PA80,100;AA100,100,90;PA100,60;"
#1 , “AA100,50,180;PA100,20;“
#1 , "AA100,0,90;PA60 ,0;AA50 ,0,180;"
#1 , "PA20,0;AA0,0,90;PU;PA50,50;CI30;"
10 configuration statement; change this statement as nec¬
essary for your computer.
20, 30 initialize the plotter and establish user-unit scaling.
40, 50 move the pen to the point 0,20, lower the pen, and
draw to the point 0,40, where a 180-degree arc is drawn
counterclockwise, centered at 0,50. The pen is then
instructed to draw to the point 0,80.
60-90 continue drawing the figure, clockwise, back to the
point 0,20, and finish with the circle centered at the
point 50,50.
CONTROLLING THE PEN AND PLOTTING 3-17
The Arc Relative Instruction, AR
DESCRIPTION
The arc relative instruction, AR, provides the means to
draw an arc with the center point located relative to the present pen
position. The arc can be drawn clockwise (CW) or counterclockwise
(CCW), with a specified arc angle and chord angle.
The instruction can be used to draw an arc of any radius, length,
and smoothness with a single instruction. The arc is drawn from the
current pen position, and its center point is located by relative X,Y
coordinates.
SYNTAX
AR X-increment, Y-increment, arc angle (, chord angle)
terminator
EXPLANATION
The AR instruction requires that both X- and Y-
increment parameters (coordinate pair) and arc angle be specified.
Increment parameters are in integer or scaled decimal format and are
interpreted as plotter units if scaling is off or user units if scaling is on.
The X- and Y-increment parameters locate the center of the arc with
respect to the present pen position. The signs of the increment parame¬
ters determine the relative location of the center of the arc. A positive
value locates that center in a positive direction and a negative value
locates that center in a negative direction. The current pen position is
the starting point of the arc.
The arc center can be located on or off the plotting surface. The arc
angle is in integer format. It is the angle, in degrees, through which the
arc is drawn; a positive arc angle draws CCW; a negative arc angle
draws CW.
The chord angle parameter is in integer format and governs the
smoothness of the arc in the same way as defined under the circle
instruction, CL The sign of the parameter is ignored, except to set the
maximum in-range limit to —32 768 or +32 767. The default chord angle
is 5 degrees. If you specify a chord length that does not divide the
sweep angle into integers, the plotter will compute the chord length up
to the nearest integer. Chords are kept the same length.
3-18 CONTROLLING THE PEN AND PLOTTING
Unlike circles, arcs are drawn using the previously commanded pen
state (up or down) and line type. If no pen state has been commanded
since initialization, pen up is assumed. If no line type has been
commanded, a solid line is drawn.
Arcs are drawn within the defined window, with clipping occurring
outside the window limits. Drawing arcs within the window conforms
to the definitions given for plotting under the PA instruction.
All parameters must be in range. Specifying out-of-range parameters
sets error 3 and the instruction is ignored.
The following BASIC programs demonstrate the use of the AR
instruction.
10 OPEN "C0M1 : 9600 ,N ,8,1 ,RS ,CS65535 ,DS ,CD'' AS #1
20 PRINT #1, "INiSPI;IP3G50,2325,6650,5325i"
30 PRINT #1 , "SC-100,100,-100,100?”
40 PRINT #1, "PA-80,-50;PD!AR0,80,S0iAR80,0,90iPU!"
50 END
10
20
30
40
configuration statement; change this statement as nec¬
essary for your computer.
enters the PI and P2 points on which to scale the
plotting area.
scales the plotting area into user units.
moves the pen to the point -80,-50, draws a 90-degree
CCW arc centered 0,80 units relative to the present pen
position, then draws a 90-degree arc centered 80,0
units relative to the 0,30 absolute pen position. Note
that a pen down command, PD, is required to draw the
arc.
(0,30)
CONTROLLING THE PEN AND PLOTTING 3-19
10 OPEN “COM 1:9600,N,8,1 ,RS .CS65535 ,DS ,CD“ AS #1
20 PRINT #1, "IN;SP1;IP3650,2325,6650 ,5325;"
30 PRINT #1, "SC-100,100,-100,100;“
40 PRINT #1, "PA-100,40;PD;PR60,0;AR0,-40,-90;"
50 PRINT #1, "AR40 ,0,90;PRS0 ,0;SP0;"
60 END
In this example, line 40 moves the pen to the point —100,40, lowers the
pen, and plots 60,0 units relative to the previous pen position, —100,40. —-
It then draws a 90-degree CW arc centered at 0,-40 units relative to the
new —40,40 pen position, and follows it with a 90-degree CCW arc
centered 40,0 units relative to the 0,0 pen position, the endpoint of the —
first arc. Finally, it plots 60,0 units relative to the pen position 40,-40,
the endpoint of the second arc.
(-100,40) (-40,40)
The Fill Type Instruction, FT
DESCRIPTION
The fill type instruction, FT, selects the type of area fill
for use with an RA, RR, or WG instruction.
|!£1X| The instruction can be used to enhance pie charts, bar charts,
and other graphs with solid fill, parallel lines, or cross-hatching.
■3 FT (type(, spacing!, angle)))terminator
or
FT terminator
mUmULUUUI There are five types of area fill:
1. solid (lines with spacing as defined in the PT instruction; bidirec¬
tional shading)
2. solid (lines with spacing as defined in the PT instruction; unidirec¬
tional shading)*
*For the highest quality transparencies, use fill type 2.
3-20 CONTROLLING THE PEN AND PLOTTING
3. parallel lines
4. cross-hatch
5. ignored
The fill type parameter should always be an integer number between
one and four. If you do not specify a type, it will be defaulted to type one.
The current pen and line type are used for all fill types, including solid
types 1 and 2.
Spacing is the distance between parallel lines in the shade area. The
units for spacing are interpreted as plotter units if scaling is off or as
user units if scaling is on. The maximum allowable range is between 0
and 32767. If you do not specify spacing, and this is the first FT
instruction in your program, the spacing will be defaulted to 1% of the
diagonal distance between PI and P2.
If you do not specify spacing and this is not the first FT instruction in
your program, the spacing specified in the previous FT instruction will
be used. A spacing value of zero is ignored and the spacing is defaulted
to the currently defined pen thickness, PT. The spacing parameter is
ignored for solid-fill types 1 and 2, and spacing is determined by the PT
instruction.
Determine the angle (line slant) using increments of 45 degrees starting
from 0 degrees. Specifying a 0-degree angle will produce horizontal
lines, a 90-degree angle will produce vertical lines, and a 45-degree
angle will produce angular lines. If you do not specify the angle and
this is the first FT instruction in your program, the angle will be
defaulted to 0 degrees. If you do not specify the angle and this is not the
first FT instruction in your program, the angle specified in the previous
FT instruction will be used.
The following list summarizes your FT options:
Parameter
Number Type
Range
Default
fill type
integer
1-5
1
spacing
decimal
0-32767
(current units)
1% of the diagonal
distance between
PI and P2
angle
integer
±45° increments
from 0
0°
Specifying out-of-range parameters sets error 3 and the instruction is
ignored. If you send too many parameters, error 2 is set, the instruction
is executed with the first three parameters, and the rest of the parame¬
ters are ignored.
CONTROLLING THE PEN AND PLOTTING 3-21
A default instruction, DF, or an initialize instruction, IN, will reset the
fill type, spacing, and angle to default values.
The Pen Thickness Instruction, PT
DESCRIPTION
The pen thickness instruction, PT, determines the spac¬
ing between the lines drawn in a solid fill.
IIMKI The instruction can be used with the FT, RR, RA, and WG
instructions to produce a solid fill for pie charts and bar graphs.
SYNTAX
PT pen thickness terminator
or
PT terminator
EXPLANATION
The pen thickness is a decimal number representing the
physical pen width in millimetres. The range allowed is 0.1 mm -
5.0 mm (the optimum range is from 0.3 mm-0.7 mm). If you do not
specify a pen thickness, the instruction defaults to the 0.3 mm size.
Specifying out-of-range parameters sets error 3 and the instruction is
ignored. If you specify too many parameters, the plotter executes the
first parameter only, sets error 2 (too many parameters), and ignores
the rest of the parameters.
Base the spacing of your lines needed to produce a solid fill on the
current physical pen thickness. If your fill has gaps showing between
the lines, adjust the pen thickness down. If your pen is getting “fat”
through wear, or if you desire improved throughput, adjust the pen
thickness upwards.
The PT instruction pertains only to the currently selected pen. It
remains in effect only until:
a. a new pen is selected either through a new SP instruction or
manually from the front panel
b. a new PT instruction is issued.
A default instruction, DF, or an initialize instruction, IN, defaults the
pen thickness to 0.3 mm.
3-22 CONTROLLING THE PEN AND PLOTTING
The Shade Rectangle Absolute
Instruction, RA
DESCRIPTION
The shade rectangle absolute instruction, RA, is used to
define and shade a rectangle using absolute coordinates.
EES This instruction is used with the FT and PT instructions to fill
a rectangle defined by the absolute points specified in the X- and Y-
coordinate parameters. For an in-depth discussion of absolute plotting,
see the explanation of The Plot Absolute Instruction, PA, in this chapter.
SYNTAX
RA X-coordinate, Y-coordinate terminator
EXPLANATION
_ The RA instruction requires that both X- and Y-
coordinates be specified (coordinate pair). They are interpreted as
plotter units if scaling is off or as user units if scaling is on. The cur¬
rent pen position is the starting point of the rectangle and the X- and
Y-coordinates define the opposite comer of the rectangle. The maximum
parameters are decimal numbers between —32 768.0000 and 32 767.9999.
When scaling is off, the parameters are truncated to integers as follows:
• For positive numbers, the fractional portion is truncated and the
integer portion remains unchanged. For example, both 1234.4 and
1234.9 become 1234.
• For negative numbers, the fractional portion is rounded up to the
next negative integer. For example, both —1234.4 and —1234.9 become
-1235.
An RA instruction with no parameters is ignored but no error is set.
Specifying out-of-range parameters sets error 3 and the instruction is
ignored. If you specify only one parameter, the instruction is ignored
and error 2 is set. If you send too many parameters, the instruction is
executed with the first two parameters, error 2 is set, and the rest of the
parameters are ignored.
The rectangle is filled using the current pen and line type. At the
completion of the instruction, the pen is returned to the original position
and the pen state is restored. The following BASIC program demon¬
strates the use of the RA and FT instructions.
CONTROLLING THE PEN AND PLOTTING 3-23
COM
#
10 OPEN
20 PRINT
30 PRINT #1
40 PRINT #1
50 PRINT
60 PRINT
70 PRINT
80 END
#1
#1
#1
: 9600 ,N,8,1 ,RS ,CS65535 ,DS ,CD" AS #1
'INiSPI;PA5000,4000;"
1 PT.3 j FT 1;RA4000,3000!"
"FT3,100!RA6000,3000i”
'FT2;RA6000 ,5000;"
'FT4,100,4S;RA4000,5000;“
" SP0i"
4000,5000
6000,5000
5000,4000
4000,3000
6000,3000
10 configuration statement; change this statement as nec¬
essary for your computer.
20 initializes the plotter, selects a pen (pen 1), and sets the
starting position.
30 selects pen thickness, fill type 1 (solid fill, bidirectional),
and sets the X,Y coordinates for the first rectangle.
40 selects the fill type and spacing, and sets the X,Y
coordinates for rectangle 2. Notice that you do not
need to repeat the pen thickness instruction since it
will remain in effect until you select a new pen or a
new pen thickness.
50 selects the fill type and sets the X,Y coordinates for
rectangle 3.
60 selects a new fill type, spacing, and angle, and sets the
X,Y coordinates for rectangle 4.
70 puts the pen back in the carousel.
3-24 CONTROLLING THE PEN AND PLOTTING
The Edge Rectangle Absolute
Instruction, EA
DESCRIPTION
The edge rectangle absolute instruction, EA, edges a
rectangle defined in absolute coordinates.
|!£1£| This instruction draws the outline of a rectangle. It can be used
with the RA instruction to outline a filled rectangle. For an in-depth
discussion of absolute plotting, see the explanation of The Plot Absolute
Instruction, PA, located in this chapter.
EA X-coordinate, Y-coordinate terminator
EXPLANATION
The EA instruction requires that both X- and Y-
coordinates be specified (coordinate pair). They are interpreted as
plotter units if scaling is off or as user units if scaling is on. The cur¬
rent pen position is the starting point of the rectangle and the X- and
Y-coordinates define the opposite comer (diagonal endpoint) of the
rectangle. The maximum parameters are decimal numbers between
—32768.0000 and 32767.9999. When scaling is off, the parameters are
truncated to integers as follows:
• For positive numbers, the fractional portion is truncated and the
integer portion remains unchanged. For example, both 1234.4 and
1234.9 become 1234.
• For negative numbers, the fractional portion is rounded up to the
next more negative integer. For example, both —1234.4 and —1234.9
become —1235.
An EA instruction with no parameters is not executed but no error is
set. Specifying out-of-range parameters sets error 3 and the instruction
is ignored. If you send only one parameter, error 2 is set and the
instruction is ignored. If too many parameters are specified, then the
instruction is executed with the first two parameters, error 2 is set, and
the rest of the parameters are ignored.
The plotter will edge the designated rectangle, return the pen to the
starting point, and restore the pen status upon completion of the
instruction. The following BASIC program demonstrates the use of the
EA, RA, and FT instructions.
10 OPEN "CONI:9600 ,N ,8 , t ,RS ,CSS5535 ,DS ,CD" AS #1
20 PRINT #1, ’■ IN; SP1 ;PA5000,4000;"
30 PRINT #1, “PT.3;FT1;RA4000 ,3000;"
40 PRINT #1 , "SP3;EA4000,3000;"
50 PRINT #1, “SP4;FT3;RAS000 ,3000;"
60 PRINT #1 , “SP3;EA6000,3000;"
70 PRINT #1, "SP5;FT2;RA6000 ,5000;“
(Program listing continued)
CONTROLLING THE PEN AND PLOTTING 3-25
80 PRINT #1, "5P3;EA6000 ,5000;"
90 PRINT *1, "SP6;FT4,100,45;RA4000,5000;"
100 PRINT #1, "SP3;EA4000,5000;"
110 PRINT #1 , "SP0;“
120 END
10
configuration statement; change this statement as nec¬
essary for your computer.
20
initializes the plotter, selects a pen (pen 1), and sets the
starting position.
30
selects pen thickness, fill type 1 (solid fill, bidirectional),
and sets the X,Y coordinates for the first rectangle.
40
selects a new pen (pen 3) and edges the first rectangle.
50
selects a new pen, a new fill type, and sets the X,Y
coordinates for rectangle 2.
60
selects a new pen and edges rectangle 2.
70
selects a new pen, new fill type, and sets the X,Y
coordinates for rectangle 3.
80
selects a new pen and edges rectangle 3.
90
selects a new pen, new fill type, spacing and angle,
and sets the X,Y coordinates for rectangle 4.
100
selects a new pen and edges rectangle 4.
110
puts the pen back in the carousel.
The Shade Rectangle Relative
Instruction, RR
DESCRIPTION
The shade rectangle relative instruction, RR, can be used
to define and shade a rectangle using relative coordinates.
3-26 CONTROLLING THE PEN AND PLOTTING
This instruction is used with the FT and PT instructions to fill
a rectangle defined from a point located relative to the present pen
position. For an in-depth discussion of relative plotting, see the explana¬
tion of The Plot Relative Instruction, PR, located in this chapter.
SYNTAX
_ RR X-increment, Y-increment terminator
The RR instruction requires that both X- and Y-
increment parameters be specified (coordinate pair). They are inter¬
preted as plotter units if scaling is off or as user units if scaling is on.
The current pen position is the starting point of the rectangle and the
X- and Y-coordinates define the opposite corner (diagonal endpoint) of
the rectangle. As with The Shade Rectangle Absolute Instruction, RA,
the maximum parameters are decimal numbers between -32 768.0000
and 32 767.9999. When scaling is off, the parameters are truncated to
integers as follows:
• For positive numbers, the fractional portion is truncated and the
integer portion remains unchanged. For example, both 1234.4 and
1234.9 become 1234.
• For negative numbers, the fractional portion is rounded up to the
next negative integer. For example, both —1234.4 and —1234.9 become
-1235.
An RR instruction with no parameters is ignored but no error is set.
Specifying out-of-range parameters sets error 3 and the instruction is
ignored. If you specify only one parameter, the instruction is ignored
and error 2 is set. If too many parameters are sent, then the instruction
is executed with the first two parameters, error 2 is set, and the rest of
the parameters are ignored.
The rectangle is filled using the current pen and line type. At the
completion of the instruction, the pen is returned to the original position
and the pen state is restored. The following BASIC program, similar to
the one used under the RA instruction, demonstrates the use of the RR
and FT instructions.
10 OPEN "C0M1:9600 ,N ,8,1 ,RS ,CS65535 ,DS ,CD'
20 PRINT #1, "IN;SP1;PA5000,5000;"
30 PRINT #1, "PT.3;FT 1;RR1000,10005"
40 PRINT tl , "PR 1000 ,0;"
50 PRINT tl , "FT3, 100;RR1000,1000;"
G0 PRINT #1., "PR0,1 000;"
70 PRINT tl , "FT2;RR!000,1000;"
80 PRINT tl , "FT4,100,45;RR-1000,1000; H
90 PRINT tl , "SP0;"
100 END
AS tl
CONTROLLING THE PEN AND PLOTTING 3-27
20
30
40
50
60
70
80
90
5000,5000
configuration statement; change this statement as nec¬
essary for your computer.
initializes the plotter, selects a pen (pen 1), and sets the
starting position.
selects pen thickness, fill type 1 (solid fill, bidirectional),
and sets the X,Y coordinates for the first rectangle.
moves the pen relative to its current location by the
number of units specified by the X- and Y-parameters.
selects the fill type and spacing, and sets the X,Y
coordinates for rectangle 2.
moves the pen relative to its current location by the
number of units specified by the X- and Y-parameters.
selects the fill type and sets the X,Y coordinates for
rectangle 3. Notice that you do not need to repeat the
pen thickness for fill type 2 since it will remain in
effect until you select a new pen or a new pen thickness.
selects the fill type, spacing, and angle and sets the
X,Y coordinates for rectangle 4.
puts the pen back in the carousel.
The Edge Rectangle Relative
Instruction, ER
DESCRIPTION
The edge rectangle relative instruction, ER, edges a
rectangle using relative plotting.
Uliisl This instruction draws the outline of a rectangle. It can be
used with the RR instruction to outline a filled rectangle. For an in-
depth discussion of relative plotting, see the explanation of The Plot
Relative Instruction, PR, in this chapter.
3-28 CONTROLLING THE PEN AND PLOTTING
SYNTAX
ER X-coordinate, Y-coordinate terminator
EXPLANATION
The ER instruction requires that both X- and Y-
coordinates be specified (coordinate pair). They are interpreted as
plotter units if scaling is off or as user units if scaling is on. The current
pen position is the starting point of the rectangle and the X- and Y-
coordinates define the opposite corner (diagonal endpoint) of the rec¬
tangle. As with The Edge Rectangle Absolute Instruction, EA, the
maximum parameters are decimal numbers between -32 768.0000 and
32 767.9999. When scaling is off, the parameters are truncated to integers
as follows:
• For positive numbers, the fractional portion is truncated and the
integer portion remains unchanged. For example, both 1234.4 and
1234.9 become 1234.
• For negative numbers, the fractional portion is rounded up to the
next negative integer. For example, both -1234.4 and -1234.9 become
-1235.
An ER instruction with no parameters is not executed but no error is
set. Specifying out-of-range parameters sets error 3 and the instruction
is ignored. If you send only one parameter, error 2 is set, and the
instruction is ignored. If too many parameters are specified, then the
instruction is executed with the first two parameters, error 2 is set, and
the rest of the parameters are ignored.
The plotter will edge the designated rectangle, return the pen to the
starting point, and restore the pen status upon completion of the
instruction. The following BASIC program demonstrates the use of the
ER, RR, and FT instructions.
10 OPEN "C0M1:9600 ,N ,8,1 ,RS ,CS65535 ,DS ,CD M AS #1
20 PRINT #1 , w IN;SP1;PA5000 ,5000;“
30 PRINT #1, ”PT.3;FT1;RR1000,1000;"
40 PRINT *1 , U SP3;ER1000,1000;“
50 PRINT #1 , “PR 1000 ,0; M
60 PRINT *1, "SP4;FT3;RR1000,1000;"
70 PRINT #1, “SP3;ER1000,1000;"
80 PRINT #1 , “PR0,1000;"
90 PRINT #1 , "SP5;FT2;RR1000,1000;"
100 PRINT #1, "SP3;ER1000,1000*"
110 PRINT #1 , ”SP6;FT4,100,45;RR-1000,1000;"
120 PRINT #1, "SP3;ER-1000,1000;"
130 PRINT #1 , "SP0;“
140 END
CONTROLLING THE PEN AND PLOTTING 3-29
10
configuration statement; change this statement as nec¬
essary for your computer.
20
initializes the plotter, selects a pen (pen 1) and sets the
starting position.
30
selects pen thickness, fill type 1 (solid fill, bidirectional),
and sets the X,Y coordinates for the first rectangle.
40
selects a new pen (pen 3) and edges the first rectangle.
50
moves the pen relative to its current location by the
number of units specified by the X- and Y-parameters.
60
selects a new pen, a new fill type, and sets the X,Y
coordinates for rectangle 2.
70
selects a new pen and edges rectangle 2.
80
moves the pen relative to its current location by the
number of units specified by the X- and Y-parameters.
90
selects a new pen, a new fill type, and sets the X,Y
coordinates for rectangle 3.
100
selects a new pen and edges rectangle 3.
110
selects a new pen, a new fill type, spacing and angle,
and sets the X,Y coordinates for rectangle 4.
120
selects a new pen and edges rectangle 4.
130
puts the pen back in the carousel.
3-30 CONTROLLING THE PEN AND PLOTTING
The Shade Wedge Instruction, WG
DESCRIPTION
The shade wedge instruction, WG, is used to define and
shade any arc segment of a circle of a specified radius.
HMM This instruction is used with the FT and PT instructions to
produce individual arc wedges that can be combined to create a pie
chart. It is also possible to draw triangles, diamonds, pentagons,
hexagons, and octagons with this instruciton.
SYNTAX
WG radius, start angle, sweep angle (,chord angle)
terminator
CONTROLLING THE PEN AND PLOTTING 3-31
EXPLANATION
The WG instruction defines and shades an arc wedge
using the current pen and line type. This arc wedge is referenced to the
current pen position which should be thought of as the center of a circle.
The radius defines the size of the circle and can be a positive
or negative number in integer or scaled decimal format between
—32 768.0000 and 32 767.9999. If scaling is off, the radius is in plotter
units. If scaling is on, the radius is in X-axis user-units. The sign of the
radius defines the zero degree reference point for the start angle and
sweep angle.
The start angle is in integer format and defines where the first radius is
drawn. A positive start angle positions the radius counterclockwise
(CCW) from the zero degree reference point; a negative start angle
positions the radius clockwise (CW) from the zero degree reference
point. Start angles greater than ±360 degrees are interpreted modulo
360.
The sweep angle is in integer format between -32 768 and 32 767. The
sweep angle defines the number of degrees through which the arc
segment is drawn from the start point. A positive sweep angle draws
the arc segment CCW; a negative sweep angle draws the arc segment
CW. If a sweep angle greater than ±360 degrees is specified, then a
360-degree angle is used.
The chord angle is in integer format between 1-120 degrees and
governs the smoothness of the arc. The smaller the chord angle, the —
smoother the arc, but the longer it will take to draw. The total number
of chords per arc must be limited to 90. If you specify a sweep angle of
360 degrees and you specify a chord angle that is less than 4 degrees, —
the plotter will use a chord angle of 4 degrees, so that the number of
chords will be equal to 90. If you omit the chord angle, it defaults to 5
degrees. If you specify a chord length that does not divide a sweep —
angle into integers, the plotter will round the chord length up to the
nearest integer. Chords are kept the same length. If you use a sweep
angle of 360 degrees, a chord length of 120 degrees will produce a —
triangle; 90 degrees, a diamond; 72 degrees, a pentagon; 60 degrees, a
hexagon; and 45 degrees, an octagon.
At the completion of the wedge, the pen is returned to the original
position and the pen state is restored.
3-32 CONTROLLING THE PEN AND PLOTTING
The following list summarizes your WG options:
Parameter
Type
Range
Default
radius
integer/
decimal
-32 768.0000 to +32 767.9999
none
start angle
integer
MOD 360
none
sweep angle
integer
-32768 to +32767
none
chord angle
integer
1-120
5°
A WG instruction with no parameters is not executed but no error is set.
Specifying out-of-range parameters sets error 3 and the instruction is
ignored.
If you send too few parameters, error 2 is set and the instruction is not
executed. If you send too many parameters, error 2 is set, the instruction
is executed with the first four parameters, and the rest of the parameters
are ignored.
The following BASIC program illustrates the use of the WG instruction.
10
OPEN "
COM
20
PRINT
#1 ,
30
PRINT
#1 ,
40
PRINT
#1 ,
50
PRINT
#1 ,
60
PRINT
#1 .
70
PRINT
#1 ,
80
PRINT
#1 ,
90
PRINT
#1 ,
100 END
:9600,N,8,1 ,RS ,0565535 ,DS ,CD" AS #1
"IN;SP2;FT3,100;"
" PA5000 ,5000;"
"WGI 000,90,180,5;"
H SP4;FT4,100,45;"
"WG1000,270,120;"
"SP1;FT 1 ;"
“WG1 000 ,30 ,60; 11
" SP0;"
CONTROLLING THE PEN AND PLOTTING 3-33
This program produces a circle with three wedges centered at 5000,5000.
10 configuration statement; change this statement as nec¬
essary for your computer.
20 initializes the plotter and selects a pen, fill type, and
spacing.
30 sets the current pen position.
40 shades the first wedge with a radius of 1000, sweeping
from a 90-degree start angle for 180 degrees with a
chord length of 5 degrees.
50 selects the next pen, fill type, spacing, and angle.
60 shades the second wedge with a radius of 1000, sweep¬
ing from a 270-degree start angle for 120 degrees. No
chord length is specified.
70 selects the next pen and fill type.
80 shades the third wedge with a radius of 1000, sweeping
from a 30-degree start angle to complete the circle.
90 puts the pen back in the carousel.
The Edge Wedge Instruction, EW
DESCRIPTION
The edge wedge instruction, EW, is used to edge any
arc segment of a circle of a specified radius.
BJKl¥i This instruction is used to produce individual arc segments
that can be combined to create a pie chart.
SYNTAX
EW radius, start angle, sweep angle (,chord angle)
terminator
3-34 CONTROLLING THE PEN AND PLOTTING
EXPLANATION
The EW instruction outlines a wedge using the current
pen and line type. This arc wedge is referenced to the current pen
position which should be thought of as the center of the circle.
The radius defines the size of the circle and can be a positive
or negative number in integer or scaled decimal format between
-32 768.0000 and 32 767.9999. If scaling is off, the radius is in plotter
units. If scaling is on, the radius is in X-axis user-units. The sign of the
radius defines the zero degree reference point for the start angle and
sweep angle.
The start angle is in integer format and defines where the first radius is
drawn. A positive start angle positions the radius counterclockwise
CONTROLLING THE PEN AND PLOTTING 3-35
(CCW) from the zero degree reference point; a negative start angle posi¬
tions the radius clockwise (CW) from the zero degree reference point.
The sweep angle is in integer format between —32 768 and 32 767. The
sweep angle defines the number of degrees through which the angle is
drawn. A positive sweep angle draws the arc segment CCW; a negative
sweep angle draws the arc segment CW. If a sweep angle greater than
±360 degrees is specified, then a 360-degree angle is used.
The chord angle parameter is in integer format between 1-120 and
governs the smoothness of the edge. For additional information on the
chord angle parameter, see The Shade Wedge Instruction, WG, in this
chapter.
At the completion of the wedge, the pen is returned to the original
position and the pen state is restored.
The following list summarizes your EW options:
Parameter
Type
Range
Default
radius
integer/
decimal
-32 768.0000 to +32 767.9999
none
start angle
integer
MOD 360
none
sweep angle
integer
-32 768 to+32 767
none
chord angle
integer
1-120
5°
An EW instruction with no parameters is not executed but no error is
set. Specifying out-of-range parameters sets error 3 and the instruction
is ignored. If you send too few parameters, error 2 is set and the
instruction is not executed. If you send too many parameters, error 2 is
set, the instruction is executed with the first four parameters, and the
rest of the parameters are ignored.
The following BASIC program illustrates the use of the EW instruction.
10
OPEN "
com
:9600,N,8,1 ,RS,CS65535 ;
20
PRINT
#1 ,
■INjSPI;FT3,100;"
30
PRINT
#1 ,
"PA5000,5000;"
40
PRINT
#1 ,
“U61000,90,180 ,5; “
50
PRINT
#1 ,
"SP3;EW1000,90,180,5;“
60
PRINT
#1 ,
"SP4;FT4,100 ,45;"
70
PRINT
#1 ,
“UG1000,270,120; “
80
PRINT
#1 ,
“SP3;EW1000,270,120;"
90
PRINT
#1 ,
”SP1 ; FT 1;"
100
PRINT
#1 ,
“WGI000 ,30 ,60; "
110
PRINT
#1 ,
“SP3;EU1000 ,30 ,60; ”
120
130
PRINT
END
#1 ,
“SP0;"
3-36 CONTROLLING THE PEN AND PLOTTING
5000,5000
This program produces a circle with three wedges centered at 5000,5000.
10 configuration statement; change this statement as nec¬
essary for your computer.
20 initializes the plotter and selects a pen, fill type, and
spacing.
30 sets the current pen position.
40 shades the first wedge with a radius of 1000, sweeping
from a 90-degree start angle for 180 degrees with a
chord length of 5 degrees.
50 selects a new pen and outlines the first wedge.
60 selects a new pen, fill type, spacing, and angle.
70 shades the second wedge with a radius of 1000, sweep¬
ing from a 270-degree start angle for 120 degrees.
80 selects a new pen and outlines the second wedge.
90 selects a new pen and fill type.
100 shades the third wedge with a radius of 1000, sweep¬
ing from a 30-degree start angle for 60 degrees to
complete the circle.
110 selects a new pen and outlines the third wedge.
120 puts the pen back in the carousel.
CONTROLLING THE PEN AND PLOTTING 3-37
Chapter
Enhancing the Plot
What You’ll Learn in This Chapter
Now that you can draw lines, you are ready to create your own plots. In
this chapter you will learn how to enhance your plots by using HP-GL
instructions to draw tick marks on axes or create grids, draw a symbol
or character of your choice at each data point, and draw dashed or
dotted lines. All these enhancements will make your data easier to
interpret.
HP-GL Instructions Covered
XT The X-Tick Instruction
YT The Y-Tick Instruction
TL The Tick Length Instruction
SM The Symbol Mode Instruction
LT The Line Type Instruction
ENHANCING THE PLOT 4-1
The Tick Instructions, XT and YT
DESCRIPTION
The tick instruction,
current location. The tick instruction
the current pen location.
XT, draws a vertical X-tick at the
, YT, draws a horizontal Y-tick at
lAHvl These instructions can be used to draw tick marks on axes,
draw grid lines by making the tick length 100%, or draw horizontal or
vertical lines either centered on or ending at the current pen position.
SYNTAX
XT
YT
terminator
or
terminator
EXPLANATION
Neither instruction requires parameters; numeric
parameters set error 2, and the instruction is executed.
The tick mark will be drawn at the current pen position whether the
pen is up or down.
The tick length is specified by the tick length instruction, TL. If no tick
length is specified, the length defaults to 0.5% of (P2 X - Pl x ) for YT or
0.5% of (P2 y - Ply) for XT for each (positive and negative) portion of
the tick. Refer to The Tick Length Instruction, TL, which follows.
The following example draws a horizontal line 3000 plotter units long,
places X-ticks at the endpoints and at X-locations 1200 and 2200, and
raises and stores the pen.
“ IN 5 SP2 s PA200, 500 ; PD ! XT ; PR 1000 ,0; XT i“
"PR 1000,0; XT)PR 1000,0jXT;PU;SP0;"
I-1-1-1
The Tick Length Instruction, TL
DESCRIPTION
The tick length instruction, TL, specifies the length of
the tick marks drawn by the plotter. The tick lengths are specified as a
percentage of the horizontal and vertical distances between the scaling
points PI and P2.
ItItI The instruction can be used to set the length of both positive
and negative portions of tick marks. The instruction can be used with
only one parameter to suppress the negative portion of a tick mark, or
with a first parameter of zero to suppress the positive portion of the
tick. Setting the tick length, tp, to 100 enables the user to draw grids
easily, using XT and YT instructions.
4-2 ENHANCING THE PLOT
SYNTAX
TL
TL
tp (,tn) terminator
or
terminator
EXPLANATION
Both parameters must be between —128 and +127.9999.
Use of positive parameters is recommended. For most applications,
parameters will be between 0 and 100.
The up and right tick length, tp, determines the length of the upward
portion of the tick marks drawn along the X-axis and the right-side
portion of the tick marks drawn along the Y-axis, taking PI as the
lower-left corner.
The down and left tick length, tn, determines the length of the down¬
ward portion of the tick marks drawn along the X-axis and the left-side
portion of the tick marks drawn along the Y-axis, taking PI as the
lower-left corner.
The values specified by parameters tp and tn are a percentage of the
vertical scale length (P2 y — Ply) when used with the XT instruction,
and a percentage of the horizontal scale length (P2 X - Plx) when used
with the YT instruction. Note the actual tick length is a function of the
scaling established by PI and P2, and the length of ticks on the X- and
Y-axes will be different even if the same tick length percentage value is
specified for both XT and YT, unless the area defined by PI and P2 is
square.
The plotter, when initialized, automatically sets the tick length values
to 0.5% of the scaling lengths (P2 y - Pl y ) and (P2 X - Plx). A TL
instruction with no parameters will default to the same values. A TL
instruction with only one parameter specifies the length of tp, and tn
will be zero. A negative tp parameter will draw a negative tick just as
would be drawn by a tn with a positive parameter. Likewise, a negative
tn parameter will draw a positive tick. Use of negative parameters is
not recommended both because the results are more difficult to visualize
and programs with negative parameters will not be compatible with
other HP plotters. A TL instruction remains in effect until another TL
instruction with valid parameters is executed or an IN or DF instruction
is executed.
The following example draws both tick marks and grid lines. The grid
lines are a result of specifying 100% tick length. The horizontal tick
marks on the left-most grid line are drawn using the default tp,tn. The
tick marks on the second grid line have a positive tick length of 1% and
no negative tick. The tick marks on the third grid line have no positive
tick and a negative tick length of 5%. Note that these last tick marks
are drawn by the YT instruction even though the PU instruction is in
effect. However, the moves to the next tick location are made with the
pen up, and hence, the grid line is not retraced. A reduced version of the
plot follows.
ENHANCING THE PLOT 4-3
10
OPEN “
C0M1:9600,N,8,1 ,RS .CS65535 ,DS ,CD" AS #
20
PRINT
#1 . “ INiPA300,279 5 SP2;PD;TL 1 00iXTi“
30
FOR 1 =
'1 TO 10
40
PRINT
#1 , “PR 1000,0;XT; “
50
NEXT I
60
PRINT
#1 , ”TL;PU;PA300,279iPD;"
70
GOSUB
1000
80
PRINT
#1 . "TL1 ,0;PU;PA 1300 ,279;PD;“
90
GOSUB
1000
100
PRINT
#1 . “TL0 ,5;PU;PA2300 ,279j“
1 10
GOSUB
1000
120
PRINT
#1 , “PA300 ,7479;TL100;YT;PU;SP0;“
1000 REM SUBROUTINE TO DRAW TICKS
1010 FOR J=1 TO 9
1020 PRINT #1, "PR0.7205YT;"
1030 NEXT J
1040 RETURN
1050 END
The Symbol Mode Instruction, SM
DESCRIPTION
The symbol mode instruction, SM, is used with PA and
PR instructions, and provides the means to draw a single character
which is centered at the end of each vector.
4-4 ENHANCING THE PLOT
BEal Symbol mode plotting can be used to draw a specified char¬
acter at each data point and thus to create scattergrams, geometric
drawings, or multiple-line graphs where lines are easy to differentiate.
SYNTAX
SM
SM
c terminator
or
terminator
EXPLANATION
An SM instruction without parameters turns off symbol
mode. When a parameter is present, it is limited to a single character,
which must be one of the printing characters of the character set cur¬
rently selected.
NOTE: Remember that the first character after the mnemonic will be
interpreted as the parameter. ■
After an SM instruction has been executed, subsequent PA and PR
instructions function as described in the previous chapter, except that
the specified symbol mode character is drawn at the end of each vector
and is centered on the plotted point. (A character drawn at a point
using the label instruction, LB, would not be centered on the point.)
Drawing of the character is independent of the current pen state (up or
down); the character is always drawn at each point specified in the PA
and PR instruction.
The character is drawn according to the character set selected when the
SM instruction is executed. The character does not change even if a
new set is selected. An SM instruction remains in effect until another
valid SM instruction is executed or an IN or DF instruction is executed.
The size (SI and SR), slant (SL), and direction (DI and DR) instructions
affect the character drawn.
An SM instruction can specify any printing character (decimal values
33 through 126). The semicolon (decimal value 59) is used only to cancel
symbol mode (SM;) and cannot be selected as the symbol to be drawn
at the endpoint of each vector. Specifying a space (decimal value 32) or
any control character also cancels symbol mode.
The following example shows symbol mode plotting with the pen up
and the pen down as might be used in line graphs, geometric drawings,
and scattergrams.
"IN;SP1;SM*;PA200,1000;"
''PD400,1 230,600,1 560,900,1670,1500,1600 ,2000 ,2000; "
"PU;SM;PA100,300;SM3;"
"PA300,500,500,450,900,850,1350,1300,2100,1350;PU ; "
“SM;PA 1900,560;PD;SMY;PA3300,1250;"
"SMZ;PA3500,950;SMX;PA1900,560;PU;SP0;"
ENHANCING THE PLOT 4-5
Plot showing symbol mode:
The Line Type Instruction, LT
DESCRIPTION
The line type instruction, LT, specifies the type of line
that will be used with PA and PR instructions, and for all area fill.
HMM This instruction can be used with PA and PR instructions to
draw dashed or dotted lines. This facilitates trace differentiation on
multiple-line graphs and enables emphasis or deemphasis of plotted
lines or grids. One line type causes only dots to be plotted at each data
point.
EHilLZJ LT pattern number (,pattern lengt) terminator
or
LT terminator
EXPLANATION
numbers.
Shown below are the line patterns and their pattern
0 -
1 -
2 -
3-
4-
5-
6 -
specifies dots only at the points that are plotted.
-One pattern length
No parameter (Default Value)
The shaded portion of each of the line patterns above is one complete
segment of the pattern.
4-6 ENHANCING THE PLOT
The pattern number parameter is in decimal format but is truncated to
an integer. This parameter should be between 0 and 6; a parameter in
this range sets the line type as shown in the preceding illustration. A
parameter in the range 7 to 127.9999 is ignored; the line type does not
change and no error is set. A parameter 128 or greater sets error 3 and
the line type does not change. A negative parameter between 0 and
-128 defaults to a solid line type and no error is set. A negative
parameter less than -128 sets error 3 and the line type does not change.
When the first parameter is between 0 and 127.9999, the second param¬
eter is used. This optional pattern length parameter is in decimal
format. Both integer and fractional parts are used. This parameter
specifies the length of one complete pattern and is expressed as a per¬
centage of the diagonal distance between the scaling points PI and P2.
When this parameter is positive and less than 127.9999, the pattern
length is set to this length. When this parameter is negative or is
greater than or equal to 128, the previous pattern length is used and
error 3 is set. If a pattern length parameter is not specified, a length of
4% is used.
NOTE: If a vector ends in the pen-up portion of the pattern, a pen down
instruction, PD, will not physically put the pen down until the next
vector instruction is executed and the pen has moved so it is in a pen-
down portion of a pattern segment. The pen up instruction clears the
carry-over portion of a pattern segment. ■
ENHANCING THE PLOT 4-7
r i
Chapter
Labeling
What ^bu’ll Learn in This Chapter
In this chapter you will learn about character sets and labels used to
create effective annotated graphics. You will learn how to designate
and select character sets, how to use the label instruction with both
constant and variable parameters, and how to set the size, slant, and
direction of labels. Character spacing, moving the pen any number of
character widths and/or lines, and designing your own characters will
also be discussed.
HP-GL Instructions Covered
CS The Designate Standard Character Set Instruction
CA The Designate Alternate Character Set Instruction
SS The Select Standard Character Set Instruction
SA The Select Alternate Character Set Instruction
DT The Define Terminator Instruction
LB The Label Instruction
DI The Absolute Direction Instruction
DR The Relative Direction Instruction
CP The Character Plot Instruction
SI The Absolute Character Size Instruction
SR The Relative Character Size Instruction
SL The Character Slant Instruction
UC The User-defined Character Instruction
Terms You Should Understand
Label Terminator — the final character in every label string; it takes
the plotter out of label mode so that characters are no longer drawn but
are again interpreted as HP-GL instructions and parameters. Its default
value is the ASCII character ETX (decimal equivalent 3), but it may be
redefined using the DT instruction.
Character Space Field — the space occupied by a single character, to¬
gether with the space between it and the next character and the space
above the character which separates it from the previous text line.
LABELING 5-1
Label Start Point — the current pen position. Before executing the LB
instruction, move the pen to the location where labeling is to begin.
You can do this by using, for example, a PA, PR, or CP instruction or
by using the front-panel controls.
Plotter Character Sets
The plotter has the capability of lettering with any of 19 internal
character sets. Most of the character sets have identical upper- and
lowercase alphabetic characters and identical numerals. The symbols
and punctuation marks vary from set to set, making annotation in
several languages possible. The plotter, when initialized, automatically
sets both the standard and alternate character sets to character set 0
which follows:
CHARACTER SET 0
! ”#$%&• () #+. - ,/0123456789: ; <=>?©
ABCDEFGHIJKLMNOPQRSTUVWXYZ [\]
abcdefghijklmnopqrstuvwxyz {| } ~
Some examples of annotation in foreign languages are found below.
Notice that the label string in the HP-GL label instruction shows the
character in the character set of the keyboard on which the instruction
is entered or uses the CHR$ function if that ASCII character code is
not available on the computer’s keyboard.
M SP2;PA5000 ,5000 ; "
“CS33;LB60 8r DR ,, +CHR$( 93 )+ ,, BER ,, +CHR$( 3 )
DRUBER
"SP2;PA5000 ,4000; "
“CS4;LBfsu compan“+CHR$ <124)+“ia?“+CHR$(3 )
cL s u c ompa nia?
"SP2;PA5000 ,3000; ‘
"CS30;LB35-50 "+CHR$ (93 )+"R“+CHR$(3 )
o
5-2 LABELING
When using character sets 1-4, the plotter will perform an automatic
backspace before drawing an accent above the letter. Therefore, when
an accented letter is required, enter the letter first, followed by the
accent. When using sets 30-39, these same accented characters are
plotted as a single character including the accents.
For a complete listing of all 19 character sets, refer to Appendix C.
The Designate Standard Character Set
Instruction, CS
DESCRIPTION
The designate standard character set instruction, CS,
provides the means of designating one of the 19 character sets (0-4, 6-9,
and 30-39) as the standard character set.
BAflyl The instruction can be used to change the standard character
set to one with characters appropriate for your application. It is espe¬
cially useful when labels are in a language other than English.
SYNTAX
CS character set number terminator
EXPLANATION
The character set number can be 0-4, 6-9, or 30-39.
The set designated by the CS instruction is used for all labeling
operations when the standard set is selected by the SS instruction or by
the control character shift-in (decimal equivalent 15) in a label string.
Character set 0 is automatically designated as the standard character
set whenever the plotter is initialized or set to default values.
A CS instruction executed while the standard set is selected will imme¬
diately change the character set used for labeling. CS instructions
executed while the alternate set is selected will not change the set used
for labeling until the standard set is selected.
A CS instruction with no parameters defaults to set 0. A CS instruc¬
tion with invalid parameters sets error 5 (unknown character set), and
the instruction is ignored.
The Designate Alternate Character Set
Instruction, CA
DESCRIPTION
The designate alternate character set instruction, CA,
provides the means of designating one of the 19 character sets (0-4, 6-9,
or 30-39) as the alternate character set.
yfltl The instruction can be used to provide an additional character
set that can be easily accessed from a program, especially when a
single label contains characters found in two different sets.
LABELING 5-3
SYNTAX
EXPLANATION
CA character set number terminator
The character set number may be from 0-4, 6-9, or
30-39. The set designated by the CA instruction is used for all labeling
operations when the alternate set is selected by the SA instruction or
by the control character shift-out (decimal equivalent 14) in a label
string. Character set 0 is automatically designated as the alternate
character set whenever the plotter is initialized or set to default values.
A CA instruction executed while the alternate set is selected will imme¬
diately change the character set used for labeling. CA instructions
executed while the standard set is selected will not change the set used
for labeling until the alternate set is selected.
A CA instruction with no parameters defaults to set 0. A CA instruction
with invalid parameters sets an error 5 (unknown character set), and
the instruction is ignored.
The Select Standard Set Instruction, SS
DESCRIPTION
The select standard set instruction, SS, provides the
means of selecting the standard set designated by the CS instruction as
the character set to be used for all labeling.
Ufilsl The instruction may be used to shift from the currently desig¬
nated alternate character set to the currently designated standard
character set so characters in another set may be accessed. Using the
control character shift-in (decimal equivalent 15) inside a label string is
equivalent to executing this instruction.
SYNTAX
SS terminator
EXPLANATION
No parameters are used. Any parameters which follow
the instruction set error 2, and the standard set is selected.
The standard ASCII character set (set 0) is automatically selected
when the plotter is first turned on, initialized, or set to default values.
The standard set can be selected within a label instruction by sending
the ASCII control character for shift-in (decimal equivalent 15).
The Select Alternate Set Instruction, SA
DESCRIPTION
The select alternate set instruction, SA, provides the
means of selecting the alternate set designated by the most recent CA
instruction as the character set to be used for all labeling.
KslsSsI The instruction may be used to shift from the currently desig¬
nated standard character set to the currently designated alternate
5-4 LABELING
character set to access characters in a second set. Sending the control
character shift-out (decimal equivalent 14) inside a label string is
equivalent to executing this instruction.
SYNTAX
SA
terminator
EXPLANATION
No parameters are used. Any parameters which follow
the instruction set error 2, and the alternate set is selected.
The instruction should be executed before executing a label statement
whenever the alternate character set is to be used. The alternate set can
be selected within a label instruction by sending the ASCII control
character for shift-out (decimal equivalent 14). Shift-in and shift-out are
particularly useful when a line of text must be composed with symbols
from two character sets.
The following instruction label using two different character sets where
the underline is drawn with and without a backspace. The shift-out
character is used to change from the standard to the alternate set.
"SP2;PA5000,1000;"
" CS0;CA4; SS ;LBS_E_T_0_"+CHR$( 1 4 >+ ,, S_EJT_4_ M +CHR$< 3 )
SET 0 SET4
The Define Terminator Instruction, DT
DESCRIPTION
The define terminator instruction, DT, provides the
means to specify the character to be used as the label terminator.
UHll The instruction can be used to change the label terminator
from its default value if ETX (decimal equivalent 3) cannot be used by
your computer.
SYNTAX
DT t terminator where t is the label terminator.
EXPLANATION
The label mode can only be terminated by sending a
label terminator at the end of the label character string. ASCII control
characters (decimal equivalent 1 through 32 and 127) can be defined as
label terminators and will not print when invoked, although the function
normally performed by the character will be performed (i.e., LF will
terminate a label but will also cause a line feed). ASCII characters with
decimal equivalent values 33 through 126 can also be defined as the
terminator, but the character will be printed at the end of the label
character string. The ASCII control characters NULL (decimal equiva¬
lent 0) and ESC (decimal equivalent 27) cannot be used as label
terminators. Also, in the RS-232-C environment, ENQ (decimal equiva¬
lent 5) is not a valid terminator.
LABELING 5-5
NOTE: A DT instruction with no parameter does not establish ETX as
the default terminator, since the character immediately following the
mnemonic DT is taken as a parameter. Only a DF or IN instruction or
use of the ETX character itself as the instruction’s parameter can be
used to reestablish ETX as the label terminator. ■
The following examples of text in a label command demonstrate the
use of the label terminator.
NOTE: Remember to use the equivalent code for your computer when¬
ever you encounter the ASCII Code, ETX, in a program. On all HP
Series 80 computers, use Ctrl c. On many other computers, you can use
CHR$(3). ■
" IN ; SP2 ; SC0 -,5000,0 ,5000 ; PA0 ,4500;"
"LBDefault control character ETX"+
CHR$(I 0 )+CHR$(13 )+CHR$(3 )
"LBterminates by performing end-"+
CHR$(10 )+CHR$(13)+CHR$(3)
"LBof-text function."+CHR$(3 )
" PA0,3900 ;DT#;
"LBPrinting characters terminate ," +
CHR$( 10 )+CHR$( 1 3 >+ ,, r‘
“LBbut are also printed.#"
Default control character ETX
terminates by performing end-
of-text function.
Printing characters terminate,
#but are also printed.#
5-6 LABELING
The Label Instruction, LB
DESCRIPTION
The label instruction, LB, provides the means to letter
text, expressions, or string variables using the currently defined char¬
acter set.
1IHK1 The label instruction can be used to annotate graphs or create
text-only overhead transparencies.
SYNTAX
LB c...c t
where t is the label terminator, either the default ETX
character (decimal equivalent 3), or another character
defined by the DT instruction.
EXPLANATION
All printing characters following the LB mnemonic
are drawn using the currently selected character set. The set used is
specified by the CA or CS instructions and selected by the SA or SS
instructions, or the ASCII control characters shift-out or shift-in (deci¬
mal equivalent 14 and 15 respectively). If not specified, the default
character set (set 0) is used.
The direction, size, and slant of the characters assume default values if
not previously specified by DI, DR, SI, SR, or SL instructions.
The label mode can be terminated only by sending a label terminator
at the end of the character string. Refer to The Define Terminator In¬
struction. (With an HP-IB interface, the bus instructions interface clear
IFC, device clear DCL, or selected device clear SDC will also terminate
label mode. Refer to Bus Instructions, Chapter 10.) Unless a label
string is terminated, subsequent HP-GL instructions will appear as
labels in your plot.
LABELING 5-7
The label begins at the current pen position. Before executing the LB
instruction, move the pen to the location where labeling is to begin
using, for example, a PA, PR, or a CP instruction or by using the front-
panel controls. This establishes the lower-left corner of the first charac¬
ter space and the carriage-return point. After lettering a character, the
pen stops at the lower-left corner of the next character space as shown
below. For a further explanation of character spacing, refer to Spacing
Between Characters in this chapter.
When the plotter receives the character, carriage return, while in label
mode, it returns to a defined carriage-return point. The carriage return-
point is affected by any plot instruction, direction instructions DI or
DR, or by the controls on the plotter front panel.
Labeling with Variables
In some applications, it is desirable to label the plot using variables
rather than literals to define the label string. Many different conven¬
tions are used in different computer languages and computers to define
variable length and the character field format in which these variables
will be printed. To avoid unexpected placement of the labels defined by
variables, refer to your computer manual for a definition of the conven¬
tions used to define the output character field.
Quotation marks are used by many computers to define the literal char¬
acters that are to be sent, but variables are not included within quo¬
tation marks. The comma is used by some computers as a separator
between variables to cause the label string to be right-justified in a
specific character-field width. The unused character positions in this
5-8 LABELING
field are normally sent as leading blank spaces to establish fixed spac¬
ing between label strings. For close spacing of label strings, the blank
spaces can normally be suppressed by substituting a semicolon as a
separator between variables.
The following example illustrates use of the comma to establish fixed
spacing when using variables for labeling. When the value of X is 50,
the labels shown are produced by the given HP-GL instructions. The
first statement causes the plotter to label the value of X, X+l, and X+2.
Blank spaces between the printed integers normally include space for
the sign which may or may not be printed depending on your computer.
The number of blank character-field spaces may vary with different
computers.
PRINT tl, "LB" ,X ,X + 1 ,X+2 ,+CHR$( 3 )
50 51 ,52
l_,_ I i_,_I
Blank character field spaces
The following example illustrates the closer spacing achieved in BASIC
when semicolons separate variables in labeling commands. The semi¬
colons between the variables cause suppression of blank spaces. The
space between the printed integers varies with different computers, but
normally includes the sign space.
PRINT tl , M LB M ;X;X+1;X+2;+CHR$<3)
50 51 52
Any spaces required to fit into the context of the item being labeled
must normally be sent enclosed in quotes. The following example labels
the same variables as above, but with four extra spaces between each
of the integers. Note that four spaces enclosed in quotes are sent be¬
tween each variable, but the semicolon suppresses unwanted blank
spaces.
PRINT #1 , "LB";X;" M ;X+1;" ";X+2;+CHR$<3>
50 51 52
>—H 1 —i— 1
1 - 1 -Four extra spaces
LABELING 5-9
The Absolute Direction Instruction, DI
DESCRIPTION
The absolute direction instruction, DI, specifies the
direction in which characters are lettered.
HKlM The instruction can be used to change the direction of labeling
to a new absolute direction; by absolute we mean independent of P1,P2
settings. It is especially useful for labeling a Y-axis or labeling a
vertical graph.
SYNTAX
DI
DI
run, rise terminator
or
terminator
EXPLANATION
Run and rise are in decimal format, -128 to 127.9999,
and specify the direction according to the relationship:
6 = tan' 1
where:
rise = SIN (0)
run = COS (0)
At least one parameter must be effectively nonzero, i.e., | ^ 0.0004 |.
A DI instruction with a rise parameter of zero will produce horizontal
labeling. A DI instruction with a run parameter of zero will produce
vertical labeling.
A DI instruction with no parameters will default to the values DI1,0
(horizontal). A DI instruction with only one parameter will set error 2,
and the instruction will be ignored. A DI instruction with more than
two parameters will set error 2, and the instruction will be executed.
A change in the orientation of PI and P2 will not affect the direction of
labeling. A DI instruction remains in effect until another DI or DR
instruction, an IN or DF instruction is executed, or the plotter is
initialized from the front panel.
A DI instruction updates the carriage-return point to the current pen
position.
5-10 LABELING
When the angle, 9, necessary to establish the desired label direction is
known, the instruction DI cos0, sin0 can be used to establish label
direction.
The following example labels the years 1984 through 1991, in a circular
pattern starting with vertical labeling. The direction in which each
year is labeled is changed by 45 degrees. Then the labels in the center
are drawn to illustrate the use of cosine and sine values as parameters.
The label _*_2000 contains both a carriage return and a line feed
character before the label terminator, ETX, so the pen position at the
end of that label is one line below the beginning of that label. The fact
that DI instructions update the carriage return point can be clearly
seen by observing the pen’s position at the end of the program. The
final character in the last label is a carriage return and the pen returns
to the carriage return point, the position of the pen at the last DI
instruction.
NOTE: Check the format of the COS and SIN functions on your com¬
puter, and change these accordingly. Also, check your computer docu¬
mentation to see how your computer interprets angles. If angles are
interpreted as radians, you need to change to degrees before using the
COS and SIN functions. On the HP Series 80 computers, execute the
BASIC statement DEG. ■
10 OPEN “C0M1:9600 ,N ,8,1 ,RS .CS65535 ,DS ,CD" AS #1
20 PRINT tM , "IN;SP2;PA 1050,4450;"
30 PRINT #1, "DI0,1;LB_*_1984"+CHR$< 3 )
40 PRINT #1, "Dll ,1;LB_*_!985"+CHR$(3 )
50 PRINT #1, "Dll,0;LB_*_1986"+CHR$(3>
60 PRINT il, "D11 ,-1 ;LB * 1987"+CHR$(3 )
70 PRINT #1, "DI0,-1;LB * 1988"+CHR$(3 )
80 PRINT #1, "DI-1 ,-1 ;LB_*_1989"+CHR$<3 )
90 PRINT #1, “DI-1 ,0;LB_*_1990"+CHR$(3 )
100 PRINT HI, "DI-1 ,1;LB_*_1991"+CHR$(3 )
110 PRINT f1 , "PA 1500 ,5350;"
120 PI=3.141593
130 A=C0S(0*< PI/180 ) )
140 B=SIN(0*(P1/180 ) )
150 PRINT #1 , "DI";A;” ;B; “;"
160 PRINT #1, "LB_*_2000”+CHR$(10 ) + CHR$(13 )+CHR$(3 )
170 C=COS(-45*(PI/180))
180 D=SIN<-45*(PI/180>>
190 PRINT #1 , “DI";C; " ;D;";"
200 PRINT #1 ,"LB_RETURN P0INT"+CHR$(13 )+CHR$(3 )
210 PRINT #1 , "SP0;“
220 END
LABELING 5-11
*>_*_ 1986 n
FINAL PEN POSITION =
CARRIAGE RETURN POINT
INITIAL
PEN POSITION
066 JT*-
The Relative Direction Instruction, DR
DESCRIPTION
The relative direction instruction, DR, specifies the direc¬
tion in which characters are lettered.
IlMW The instruction can be used to change the direction of lettering
from its default direction, horizontal, to a direction relative to P1,P2. It
is useful when creating graphs to be plotted in several sizes and you
want labels to have the same relationship to the data on all plots.
SYNTAX
DR run, rise terminator
or
DR terminator
EXPLANATION
Run and rise are in decimal format, —128 to 127.9999,
and specify the label direction according to the relationship:
„ , , nse
e = tan S5T
where:
rise = SIN ( 6 )
run = COS (0)
Run and rise specify a percentage of the algebraic distance between PI
and P2 where run is the desired percentage (—128 to 127.9999) of
P2 X — Plx, rise is the desired percentage (—128 to 127.9999) of P2 y — Pl y ,
and PI and P2 are the scaling points.
5-12 LABELING
If you imagine the current pen position to be the origin, the sign of the
parameters determines in which quadrant the lettering will be. In the
example on the next page, rise and run assume all combinations of ±1
with default PI and P2.
+ RUN
+• RISE
-RUN
+ RISE
+ RUN
-RISE
-RUN
-RISE
A change in PI or P2 will affect the direction of lettering. Refer to the
section Parameter Interaction in Labeling Instructions.
A DR instruction remains in effect until another DR or DI instuction or
an IN or DF instruction or front-panel initialization is executed.
A DR instruction with no parameters will default to the values DR 1,0
(horizontal).
Specifying both parameters as zero will set error 3, and the instruction
will be ignored. Specifying only one parameter will set error 2, and the
instruction will not be executed. Specifying more than two parameters
will set error 2, and the instruction will be executed.
Spacing Between Characters
Character spacing and line spacing are functions of character size. In
the diagram below, you can see the relative position of a character, in
this case M, within the character space. The character-space field is set
indirectly by the SI instruction, since the character space height is
twice the character’s height and the character-space width is IV 2 times
the character’s width. The space above and beside a drawn character
becomes the spacing between lines and characters. The character space
is illustrated on the next page.
LABELING 5-13
CHARACTER
SPACE WIDTH = W
i
POINT = 0.67 W
CHARACTER
SPACE
HEIGHT = H
\
STARTING POINT
OF NEXT
CHARACTER
When you specify the height of a character in an SI or SR instruction,
however, you should specify the character height, not the height of a
character space.
The Character Plot Instruction, CP
DESCRIPTION
The character plot instruction, CP, moves the pen the
specified number of character-space fields.
HKiyi The instruction can be used to move the pen any number of
character spaces or lines from a point on the plotting surface, to align
with a left-hand margin, or to center or right-justify a label. Thus, the
label can be moved slightly above or below a line, spaces or lines can
be inserted in text, or labels can be centered.
SYNTAX
CP
CP
# of character-space-field widths, # of character-space-
field heights terminator
or
terminator
EXPLANATION
If no parameters are specified, a CP instruction per¬
forms a carriage return and line feed, moving one character-space-field
height down and returning to the margin defined by the carriage-
return point. The carriage-return point is the last point moved to using,
for example, a PA, PR, PU, or PD instruction or front panel controls, or
the pen position at the last DI or DR instruction. Refer to The Label
Instruction in this chapter.
The first parameter specified in the CP instruction moves the pen the
specified number of character-space-field widths to the right (a positive
value) or the left (a negative value). The second parameter moves the
5-14 LABELING
pen the specified number of character-space-field heights up (a positive
value) or down (a negative value). Note that right, left, up, and down
are relative to label direction. This is shown below.
up (+)
t
LEFT (-)-*- LABEL DIRECTION. Dll. o— ~ RIGHT(+ >
♦
DOWN (-)
DOWN (-)
I
RIGHT (+)-«- o‘i-ia *Noii33aia laavi— LEFT (-)
\
UP (+)
The pen’s position (raised or lowered) does not change when a CP
instruction is executed.
The use of the CP instruction to produce lettering along a line, but not
on top of it and alignment with a left-hand margin is illustrated in the
following program. The CP instruction in the second line moves the
label slightly above the line. The CP instruction in the third line moves
the label slightly below the line and the CP instruction in the last line
performs a carriage return, line feed to the margin established by the
plot instruction in the second line. Inserting carriage return and line
feed characters directly into the label string in the third line causes the
same effect as the CP; instruction in the last line. If the carriage return
and line feed characters are available on your keyboard, you may
prefer that method.
"IN 5 SP1;PA4000,7000;PD 1000,7000;PU;“
"CP5 ,. 35;LBABQUE THE LINE"+CHR$(3 )+"PA2000,7000;"
"XT;CP0 .95;"
"LBBELOW THE LINE"+CHR$<10 )+CHR$(13)+CHR$( 3>
"LBAND WITH A NEAT"+CHR$(3)
"CP;LBMARGIN"+CHR$(3 ) + "SP0;"
5 CHARACTER
SPACE
ABOVE THE LINE _
/ /BELOW THE LINE
/ / AND WITH A NEAT
1000,1000 2000, 1000 JN
LABELING 5-15
The Absolute Character Size
Instruction, SI
DESCRIPTION
The absolute character size instruction, SI, specifies the
actual size of characters and symbols in centimetres.
ItItI The instruction can be used to change the character size from
its default value or to another value and establish absolute character
sizing in centimetres so character size is not dependent on the settings
of PI and P2.
SYNTAX
SI width, height terminator
or
SI terminator
EXPLANATION
If parameters are included, two parameters are re¬
quired, width and height. The defined width and height are interpreted
as centimetres, must be in decimal format, and may have any value
between -128 and 127.9999.
Paper Size
Width
Height
A/A4
.187 cm
.269 cm
B/A3
.285 cm
.375 cm
An SI instruction remains in effect until another valid SI or SR
instruction is executed or the plotter is initialized or set to default
conditions. An SI instruction with only one parameter sets error 2, and
the instruction is not executed. An SI instruction with more than two
parameters sets error 2, and the instruction is executed.
The following example draws the plotter's model number, 7475A, at the
specified width of 1 cm and height of 1.5 cm.
"SI1 ,1.5;LB7475A"+CHR$(3 )
Negative SI parameters will produce mirror images of labels. A nega¬
tive SI width parameter will mirror labels in the right-to-left direction.
INSTRUCTION
"SI-.35 ,.6;LBHP "+CHR$ ( 3)
RESULTING LABEL
SH
5-16 LABELING
A negative height parameter will mirror labels in the top-to-bottom
direction.
INSTRUCTION
RESULTING LABEL
"SI.35, -. 6;LBHP"+CHR$( 3)
Two negative SI parameters will mirror the label in both directions and
the label will appear to be rotated 180 degrees.
INSTRUCTION
SI-.35,-.6;LBHP"+CHR$(3 )
RESULTING LABEL
dH
For further information on the effects of negative parameters, refer to
the section Parameter Interaction in Labeling Instructions later in this
chapter.
To produce legible characters, parameters should be greater than 0.1.
Parameter values above 18 allow no more than two characters to be
drawn on the paper.
The Relative Character Size
Instruction, SR
DESCRIPTION
The relative character size instruction, SR, specifies the
size of characters and symbols as a percentage of the distance between
scaling points PI and P2.
HRiyi The instruction can be used to define character size relative to
the distance between PI and P2 so that if the P1,P2 distance changes,
character size will adjust to occupy the same “relative’’ amount of
space.
SYNTAX
SR
SR
width, height terminator
or
terminator
EXPLANATION
If parameters are included, two parameters are re¬
quired, width and height. The defined width and height are interpreted
as a percentage of the algebraic distance between the X- or Y-coordinates
of PI and P2. The parameters are in decimal format and may have any
value between -128 and 127.9999. An SR instruction with no param¬
eters will default to the values 0.75 for width and 1.5 for height, which,
when PI and P2 are at default values, produces letters the same size as
an SI instruction without parameters.
LABELING 5-17
An SR instruction remains in effect until another valid SR or SI
instruction is executed or the plotter is initialized or set to default
conditions. An SR instruction with only one parameter sets error 2, and
the instruction is ignored. An SR instruction with more than two
parameters sets error 2, and the instruction is executed.
The following example shows how changes in PI and P2 affect labels
drawn while an SR instruction is in effect. The upper label is written
with default character size. Then PI and P2 are changed to define a
square area with 6000-plotter-unit sides. A new label is drawn. Next a
new SR instruction is executed with both width and height parameters
set to three percent. Because the area established by PI and P2 is
square, equal parameters create square letters. With default PI and P2
settings, equal parameters do not create square letters.
"IN;SP1 ;PA I 00 ,7000;LBDEFAULT SIZE"+CHR$<3 )
"IP 1000,1000 ,7000 ,7000;PA 100 ,6500;“
“LBNEW PI AND P2 CHANGE LABEL SIZE“+CHR$(3)
"SR2.5 ,2.5;PA 100 ,6000;“
“LBNEW SR INSTRUCTION"+CHR$( 10 )+CHR$(13)
“CHANGES LABEL SIZE“+CHR$(3 )
DEFAULT SIZE
NEW PI AND P2 CHANGE LABEL SIZE
NEW SR INSTRUCTION
CHANGES LABEL SIZE
Either negative SR parameters or switching the relative positions of PI
and P2 will produce mirror images of labels. Refer to The Absolute Size
Instruction, SI, and Parameter Interaction in Labeling Instructions for
more information on mirroring.
With default PI and P2, the useful range of width and height param¬
eters which produces legible characters and a label of suitable length is
approximately 0.6 to 5 percent.
The Character Slant Instruction, SL
DESCRIPTION
The character slant instruction, SL, specifies the slant
with which characters are lettered.
IIMM The instruction may be used to create slanted text, particularly
for emphasis, or to reestablish upright labeling after an SL instruction
with parameters has been in effect.
5-18 LABELING
SYNTAX
SL tan 6 terminator
or
SL terminator
EXPLANATION
The instruction may be used with or without a parame¬
ter. When a parameter is included, it is interpreted as the tangent of the
angle from vertical as shown below. Additional parameters following
the first parameter are ignored, set error 2, and the instruction is
executed. An SL instruction without parameters defaults to the same
value as SLO, and labels are not slanted.
/
The useful parameter range is ±0.05 to ±2 when using default-size
characters and up to ±3.5 for large letters.
An SL instruction remains in effect until an IN, DF or new SL
instruction is received or the plotter is initialized from the front panel.
The following example letters HP at a slant of ±45 degrees and -45
degrees.
“DF ; SP1; SI. 75,1.;PA3000,6000;"
"SL1; LBAT&T"+CHR$( 3)
"SL — 1 ;PA3000,5000; LBAT&T"+CHR$( 3)
The User-Defined Character
Instruction, UC
DESCRIPTION
The user-defined character instruction, UC, provides
the means to draw characters of your own design.
MIKiM This instruction is used to create symbols not included in the
plotter’s character sets, to draw logos, or to create your own character
fonts.
LABELING 5-19
SYNTAX
UC (pen control,)X-increment,Y-increment,(pen control,)
(X-increment,Y-increment,)terminator
or
UC terminator
EXPLANATION
Each segment of the character is drawn on a character
grid. This grid is established on each character-space field by dividing
it into 6 horizontal units and 16 vertical units. The size of the character-
space field and, hence, the grid unit is set by the current size instruction.
The size of the character-size space field and, thus, the grid is always
twice the current character height and IV 2 times the current character
width. To draw a user-defined character the same size as a character
drawn with a label instruction, design the user-defined character in the
lower-left corner of the grid with a width of four grid units and a height
of eight grid units.
6 GRID UNITS
ORIGIN POINT CHARACTER WIDTH AS SET BY SI OR SR INSTRUCTION
Character Grid
5-20 LABELING
A user-defined character is drawn in the following manner:
1. Each X,Y increment is drawn using the pen up/down status of the
most recent pen control parameter. Upon entry into a UC instruction,
the plotter sets the pen status up and the pen at the point 0,0 on the
character grid.
2. The pen moves to the point defined by each X,Y increment pair in
order. The X- and Y-increments should appear in pairs and must be
greater than -99 and less than +99. The X-increment specifies in
decimal format (-98.9999 to +98.9999) the number of primitive grid
units that the pen will move horizontally from the current pen
position. A positive increment causes the pen to move to the right,
and a negative increment causes it to move to the left.
The Y-increment specifies in decimal format (-98.9999 to +98.9999)
the number of character grid units that the pen will move vertically
from the current pen position. A positive increment moves the pen
up, and a negative increment moves the pen down. All references to
the right, left, up, and down are relative to the current label direction.
UC characters are mirrored in the same way as labeled characters.
Unmatched X,Y increments are discarded, error 2 is set, and the rest
of the character is drawn.
3. The pen control parameter is specific to the UC instruction. The pen
control parameters are as follows:
Integers > +99 interpreted as pen down
Integers < -99 interpreted as pen up
Integers > +127.9999 or < -128 sets error 3 (out-of-range parameter)
Since the plotter sets the pen status to up, nothing will be drawn by
a UC instruction which does not have at least one pen down
parameter. A UC instruction without a pen down parameter will
result in a pen movement of one character-space field horizontally. A
UC instruction with no parameters causes the pen to return to the
carriage return point. Once a pen down parameter is specified, the
pen remains down for the following X,Y increment moves until a
pen up parameter is specified or a UC isntruction is completed. Upon
termination of the UC instruction, the pen is raised and moves to the
next character origin. The pen then assumes the status (up or down)
of the most recent PU and PD instruction.
The position of the pen when the UC instruction is executed becomes the
character origin point. The initial X,Y increment is relative to the char¬
acter origin point, and each subsequent move is relative to the last com¬
manded pen position. Upon completion of the user-defined character,
the pen is automatically moved one character-space field to the right of
the character origin point. This point becomes the current pen position
and, hence, the character origin point for the next character (if any).
LABELING 5-21
The following example generates a 2 symbol which is the same size as _
an uppercase letter. For comparison, an “E” is drawn with the label
instruction. The example shows how size instructions affect both user-
defined characters and labeled characters. The HP-GL instructions __
appear in quotation marks in the BASIC PRINT statements. Other
BASIC statements, FOR and NEXT, are included in this example.
20 PRINT#], "IN;SP1;PA 1000,1000 ;" —
30 FOR A=. 1 9 TO .89 STEP .1
40 PRINT #1 , "SI" ,A ,A*1.4
50 PRINT #1 , "UC4,7,99,0,1 ,-4,0,2,-4,-2,-4,4,0,0,1j" —
60 NEXT A
70 PRINT #1 , “PA 1000,1750;"
80 FOR B=.19 TO .89 STEP .1 —
90 PRINT #1 , “SI" ,B ,B*1.4
100 PRINT #1 , “LBE"+CHR$(3 )
110 NEXT B —
E
User-defined characters need not fit into a single character-space field. _
In the next example, the user-defined character takes up more than one
character space. Since this character is to be followed by a label, a CP
instruction must be added to move the current pen position beyond the _
limits of the user-defined character. The reference point for parameters
of CP instructions is the pen position at the completion of the user
defined character, one character-space field to the right of the origin of - r
the user-defined character.
“ IN ; SP 1 s PA 1 000 ,5000 5 SI. 25 ,. 4 s “
“UC0,4,99,1.75,0,1.5,4,3,-8,3,8,3,-8,3,8, —
3,-8,1 .5,4,1 .75,0!"
“CP3.25,0;LB1000 ohms"+CHR$<3 )
AAAr 1000 ohms
User-defined characters are drawn using the current character size,
slant, and direction. It is also possible to change the size of a user-
defined character by changing each X- or Y-increment parameter by a —
5-22 LABELING
constant multiple. Send the following instructions to the plotter. The
resistor drawn will be twice the size of the resistor drawn in the last
example.
"IN; SP1;PA 1000,4500 5 SI .25 ,.4;“
"UC0 ,8,99,3.5,0,3,8,E ,-16,6,16,6,-16,6,16,
6,-16,3,8,3.5,0!"
A/W
Parameter Interaction in
Labeling Instructions
There are three factors which interact and affect the direction and
mirroring of labels; the label direction as specified by DI or DR
instructions or default direction, the sign of the parameters for the size
instructions SI or SR, and the relative positions of PI and P2. These
interactions are complex. This section considers the four possible combi¬
nations of DI, DR, SI, and SR and illustrates the effects of various
parameters and settings of PI and P2 on labels.
The labels used in the illustrations are the instructions which cause the
direction, size, and mirroring of the label. All descriptions are in terms
of the standard X,Y coordinate system. An arrow is shown for each
label; this arrow is the baseline along which labeling occurs and shows
the left-to-right direction that is the standard direction of a label with¬
out mirroring. The same P1,P2 area, that area set by default PI and P2,
is always used. During the course of the illustrations, PI and P2 are
assigned to opposite corners of this rectangle in all possible ways. The
values used for X-coordinates of PI and P2 are 250 and 10 250; the
values used for the Y-coordinates of PI and P2 are 596 and 7796.
Use of DI and SI
When DI and SI instructions are used together, the DI instruction estab¬
lishes the label’s direction and the SI instruction establishes its size.
The direction serves as the axis along and about which labels (written
with negative SI parameters) are mirrored. Positions of PI and P2 do
not affect the labels. Refer to The Absolute Direction Instruction, DI,
and The Absolute Size Instruction, SI.
Two examples of mirrored labels are shown on the next page. In the
first example, the DI parameters 3,2 place the directional line in the
first quadrant. The negative width parameter of the SI instruction
mirrors the label in the right-to-left direction. In the second example,
LABELING 5-23
the DI parameters 3 , -2 place the directional line in the fourth quad¬
rant. The negative height parameter of the SI instruction mirrors the
label top-to-bottom.
O*
Use of DR and SI
When DR and SI instructions are used together, the label size is deter¬
mined by the SI instruction and does not change with changes in the
settings of PI and P2. However, changes in the settings of PI and P2
will affect the label direction. The algebraic differences (P2 X - Plx) and
(P2 y - Ply) are multiplied by the run and rise parameters of the DR
instruction. The resulting parameters, when applied to the standard
coordinate system, determine the label baseline. Mirroring about this
baseline is determined by the signs of the SI parameters.
In illustration 3, PI and P2 are at their default settings so the algebraic
differences (P2 X —Plx) and (P2 y —Pl y ) are both positive. The DR
parameters 3 —2 are used as is and establish the directional line in the
fourth quadrant. The negative SI height parameter mirrors the label
from top to bottom.
P2
In illustrations 4 and 5, Pi is moved to the lower-right corner and P2
becomes the upper-left corner. Now (P2 X -P1 X ) is negative. The DR
instruction as given is DR 3,-2; the run parameter of the DR instruction
is multiplied by -1 and the effective DR instruction becomes DR -3, -2
placing the directional line in the third quadrant. The negative SI
5-24 LABELING
height parameter mirrors the label from top to bottom. In illustration 5,
both SI parameters are negative and the label is mirrored in both
directions, making it appear upright.
Use of DI and SR
When the DI instruction is used with SR, only the DI instruction affects
the directional baseline of labels; changes in the relative positions of Pi
and P2 do not affect the baseline. Mirroring about this baseline will
occur when either a negative SR width or height parameter with a posi¬
tive difference (P2 X - Plx) or (P2 y - Ply) or a positive SR parameter
and a negative difference are present. If respective parameters and dif¬
ferences are both positive or both negative, no mirroring will occur.
Label direction is horizontal for all illustrations in this section. The
first three illustrations are drawn with PI and P2 at their power-on
settings. In example 6, the SR; instruction is the same as SR.75,1.5.
Since the parameters are positive, there is no mirroring. In example 7,
the negative width parameter causes mirroring right-to-left. In example
8, the negative height parameter causes mirroring top-to-bottom.
LABELING 5-25
P2
Dll, 0; SR
0
5 .1 ,5V -9\2 ;0 ,£!□
pi
©
Dll' 0* 2tr A2* -r 2
In the next three illustrations, PI and P2 have been changed so PI is
lower right and P2 is upper left. Hence (P2 X - Plx) is negative and
anything with a positive SR width parameter is mirrored right-to-left,
e.g., illustrations 9 and 11. The effect of the negative width parameter
in illustration 10 is cancelled by the negative difference (P2 X — Plx).
P2
Dll, 0; SR-. 75, 1. 5
pi
x
s *i- ‘sz. *as *o ‘tia
In the next illustrations, PI and P2 have both been flipped so PI is
upper right and P2 is lower left. Now any positive parameter causes
mirroring and any negative parameter cancels mirroring. This can be
seen in examples 12, 13, and 14.
5-26 LABELING
as*criia p i
DII* 0* SB-* A2* r 2
©
.1- .5V .82 $0 .IIQ
Use of DR and SR
When the DR and SR instructions are used together, interactions are
most complex. Using only standard settings of PI and P2, where PI is
the lower-left corner and P2 is the upper-right corner, will make it easier
for you to establish the direction and mirroring of labels you desire. DR
parameters interact with the albegraic differences (P2 X - Plx) and
(P2 y - Ply) to establish label direction, and SR parameters interact
with these differences to create mirroring. Signs of both parameters
and differences are important. A negative sign in either the parameter
or the distance will affect both DR and SR instructions. Having both
parameter and distance either positive or negative will cause standard
direction or no mirroring.
The following examples show the most complex cases, with PI and P2
in nonstandard locations. Label 15 is drawn with the instructions
DR 1,1; SR in effect, PI in the lower-right corner and P2 in the upper-
left corner. The label baseline is in the second quadrant, not the first,
because (P2 X - Plx) is negative and the DR run parameter is positive.
Likewise, the label is mirrored left-to-right because that distance is
negative while the parameter is positive. In labels 16 and 17, the label
direction baseline is in the third quadrant because both (P2 X - Pl x ) and
(P2 y - Ply) are negative. Label 16 is mirrored in both directions. (Rotate
the manual so the arrow points to +45 degrees to see this more clearly.)
In label 17, the label is not mirrored because both parameters and dis¬
tances are negative. (Again, this may be easier to see if you rotate the
manual.)
LABELING 5-27
Advanced Programming Tips
When drawing labels, you often wish to position them precisely in rela¬
tion to a specific point. Unless positioned differently by the programmer,
labels are written beginning at the current pen position which marks
the baseline of the label.
The following BASIC program illustrates various ways to center labels.
The program uses the BASIC function LEN to find the length of the
string. This length is used to determine horizontal adjustments, i.e.,
how many character-space widths the pen must be moved to achieve
the desired positioning. Vertical moves are in terms of character-
space heights. Since an uppercase letter is half the height of a character
space, a vertical movement of one-quarter character space down will
center uppercase letters on the point; notice the parameter is negative.
A parameter of -0.5 will cause the top of uppercase letters to be level
with the point.
Symbol mode plotting, with an * as the symbol, has been used here to
show pen position at the start of the label instruction. The character
plot instruction which positions the label is shown above each label.
10 OPEN "COMI:9600 ,N ,8,1 ,RS,CS65535,DS,CD" AS #1
20 DIM A$(40),B$(40) ,C$(40 )
30 AS = "THIS LABEL IS RIGHT JUSTIFIED"
40 PRINT #1 , "IN;SP1 ;SM*;PA6000 ,5500;"
50 PRINT #1, "CP";-LEN(AS );"0;LB" ;AS+CHRS(3)
G0 B$ = "THIS LABEL IS CENTERED BELOW THE POINT"
70 PRINT #1 , "PA4500 ,5000;"
80 PRINT #1, "CP"; -LEN(B$ )/2;"-.5;LB";B$+CHR$(3 )
90 C$ = "UERITCALLY CENTERED LABEL"
100 PRINT #1, "PA2750,4500;"
110 PRINT #1, "CP0 .25;LB";C$+CHR$(3 )
120 END
"CP" i-LEM AS); "0; "
THIS LABEL IS RIGHT JUSTIFIED*
"CP";-LEN(B$)/2;"-.5;"
THIS LABEL IS CENTERED BELOW THE POINT
"CP0.-.25;''
VERTICALLY CENTERED LABEL
LABELING 5-29
Chapter
Digitizing
What \bu’ll Learn in This Chapter
The plotter can be used as a digitizer as well as a plotter. Digitizing
consists of moving the pen or digitizing sight to a point on the plotting
surface, entering the point, and sending the coordinates of that point to
the computer. This chapter describes the three instructions used in
digitizing, and contains a discussion of the steps required by a computer
program for digitizing; sample programs are also included. Included in
the discussion are three different methods of assuring that a point has
been entered. The method you will use will depend on your application
and your interface (HP-IB or RS-232-C).
HP-GL Instructions Covered
DP The Digitize Point Instruction
DC The Digitize Clear Instruction
OD The Output Digitized Point and Pen Status Instruction
Terms You Should Understand
Digitizing — converting information, in this case pen position and up/
down status, to digital information so that it can be understood by the
computer.
Output Terminator — the character or characters sent by the plotter at
the end of the response to an output instruction. It is interface-
dependent.
DIGITIZING 6-1
Preparing Your Plotter for Use
as a Digitizer
A plotter with an HP-IB interface must be set to an address less than
31 because the plotter cannot send the coordinates of a digitized point
to the computer when it is in listen-only mode.
Use of a digitizing sight, available as an accessory with the 7475, is
recommended. The sight should be loaded manually into the pen holder
itself. Slip the digitizing sight gently into the pen holder just as you
would slip in a pen.
CAUTION
The sight should not be stored in a pen stall; do not
store using front panel buttons or an SP command.
Remove the sight from the pen holder before raising the
paper load lever since the sight would be stored auto¬
matically when the lever is raised.
To remove the sight from the pen holder, slip the sight out of the pen
holder.
The sight is used in the pen down position.
Loading the Sight
The Digitize Point Instruction, DP
DESCRIPTION
The digitize point instruction, DP, provides the means
to digitize points on the plotter.
lIRlfll This instruction can be used to input data for a graphics pro¬
gram or obtain the coordinates of a point or points on the plot.
6-2 DIGITIZING
SYNTAX!
EXPLANATION
terminator
No parameters are used.
When the DP instruction is received, automatic pen lift is suppressed,
the current front-panel paper-size light blinks, and the plotter is ready
to have a digitized point entered by pressing ENTER on the front panel.
When enter is pressed, the X- and Y-coordinates of that point and pen
up/down status are stored for retrieval by the OD instruction. Pressing
ENTER sets bit position 2 of the status byte, indicating a digitized point
is available for output.
After enter has been pressed, automatic pen lift is reactivated, and the
paper-size light stops blinking.
The Digitize Clear Instruction, DC
DESCRIPTION
The digitize clear instruction, DC, provides a means to
terminate digitize mode.
This instruction can be used to terminate digitize mode with¬
out entering a point. If you are using an interrupt routine in a digitiz¬
ing program to branch to some other plotting function, you could use
DC to clear digitize mode immediately after branching.
BilillAl DC terminator
MMilTlnrJIUnB No parameters are used.
When the DC instruction is received, digitize mode is terminated, and
the paper-size light stops blinking. Automatic pen lift is reactivated.
The Output Digitized Point and
Pen Status Instruction, OD
DESCRIPTION
The output digitized point and pen status instruction,
OD, is used to output the X- and Y-coordinates and pen up/down status
associated with the last digitized point.
This instruction is used after DP and enter in all digitizing
applications to return the coordinates of the digitized point to the
computer.
mJIAI OD terminator
IMMMihllLIJil No parameters are used.
DIGITIZING 6-3
The timing of output depends on the plotter’s interface (HP-IB or
RS-232-C). Refer to A Brief Word about Plotter Output in Chapter 7 for
more information.
The pen position and status are output to the computer as integers in
ASCII in the form:
X,Y,P TERM
where X is the X-coordinate of the digitized point in plotter units,
Y is the Y-coordinate of the digitized point in plotter units,
P is the pen status when the point was entered (0 = pen
up, 1 = pen down), and
TERM is the output terminator for your system (refer to Chap¬
ter 7).
The ranges of the X- and Y-coordinates are the hard-clip limits of the
plotter as determined by the setting of the paper switches.
Upon receipt of the OD instruction by the plotter, bit position 2 of the
output status byte is cleared.
Digitizing with the 7475
When using the plotter as a digitizer, it is important to ascertain that a
point has been entered before an attempt is made to retrieve that point
using the OD instruction. There are three methods for doing this.
Manual Method
The first method, which might be called the manual method, is easiest
to understand. It is not efficient in applications where many points will
be entered, or in an RS-232-C environment where the mainframe is not
adjacent to the plotter or where human intervention in program execu¬
tion is not possible. The steps in this method are as follows:
1. In a program, send a DP instruction to the plotter. Follow the DP
instruction immediately with a statement that will cause the pro¬
gram to display or print a message prompting you to enter a point.
Follow the prompt with a statement that will cause the program to
pause until instructed to continue. The BASIC statement PAUSE
will accomplish this.
2. Move the digitizing sight (pen) to the point to be entered, using front-
panel buttons. Final positioning should be done with the sight (pen)
down.
3. Press enter on the plotter’s front panel. Now resume running of the
program. This is done on HP desktop computers by pressing the key
marked continue or cont.
6-4 DIGITIZING
4. The program step following the pause will now be executed. The
next steps of the program, in order, should be an OD instruction to
the plotter, a read statement by the computer to read the X- and
Y-coordinates and the pen status, a statement to remove the prompt
(requesting you to enter a point) from the screen, and then steps to
process the digitized data in the appropriate manner.
Using this method, there is no need to monitor the status byte because
the program does not proceed to the OD instruction until the user
enters a point and causes the program to resume.
A simpler procedure, using OA or OC instead of OD, can also be used.
It omits the DP in step 1 and pressing enter in step 3. Using the
shorter procedure with OC makes it possible to obtain coordinate
values in user units. Refer to Chapter 7.
A short program to digitize a single point and display the coordinates
and pen status is given below.
10 OPEN "C0M1:9600,N,8,1 ,RS ,CSE5535 ,DS ,CD" AS #1
20 PRINT #1 , "DP;"
30 PRINT "Enter a point , then press RETURN”
40 INPUT N$
50 PRINT #1 , "OD;"
60 INPUT #1 , X ,Y,P
70 PRINT X, Y, P
80 END
Monitoring the Status Byte
The second method monitors bit position 2 (the third least significant
bit) of the plotter’s status byte, which is set when a digitized point is
available. Refer to the Output Status Instruction, OS, in Chapter 7 for
more information.
There are a variety of ways to monitor bit position 2, depending on the
instructions available in the computer you are using. The status byte
can be operated on arithmetically to check for the availability of a
digitized point. Executing successive divisions of a number by a power
of two and checking the answer for an odd or even integer is a common
way of monitoring bits without converting the number to binary form.
The following example uses this method.
Example — Digitizing by Monitoring the Status Byte
The following sequence of BASIC instructions will check the proper bit
of the status byte. In line 50, the INPUT# statement reads the status
byte into a variable called Status. (INT is a function that returns the
integer portion of a number.)
DIGITIZING 6-5
10 OPEN "COM 1:9600 ,N ,8,1 ,RS ,CS65535 ,DS ,CD" AS 1 1
20 PRINT #1 , "DP;"
30 PRINT "Enter a point by pressing ENTER"
40 PRINT #1 , "OS;"
50 INPUT #1, STATUS
60 STATUS = INT(STATUS/4)
70 IF STATUS = INT(STATUS/2)*2 THEN 40
80 PRINT #1 , "OD;"
90 INPUT t 1, X,Y,P
100 PRINT X ,Y,P
110 END
Program Explanation
10 configuration statement
20 prepares plotter to accept a digitized point
30 prompts you to enter a point on the plotter and press
enter on the plotter.
40 sends the output status instruction
50 reads the status
60 shifts bits right by two positions
70 if a point hasn’t been obtained, reads status again
80 outputs the digitized point
90 reads X, Y coordinates and pen status (up/down)
100 displays X, Y coordinates and pen status
Example — Digitizing Many Points
In many applications, a large number of points need to be digitized.
When the computer is used to monitor bit position 2, the data points
may or may not be processed immediately. Generally, you need to
allocate space for the toal number of points to be digitized. Then, you
can establish a loop to process the total number of points, calling a
subroutine each time to check that a point has been entered.
A complete BASIC program follows. When prompted to enter a point,
use the cursor keys to move the digitizing sight to the desired position.
Now press the enter button on the plotter. Continue for all 25 points.
Their coordinates will be displayed on the computer’s screen after they
have all been entered.
6-6 DIGITIZING
10 OPEN "COM1:9600 ,N ,8,1,RS.CS65535,DS .CD” AS #1
20 DIM X( 25),Y(25),P(25 )
30 FOR C = 1 TO 25
40 PRINT #1 ,"DP j"
50 PRINT "ENTER POINT "*C
G0 GOSUB 140
70 PRINT #1 ,"OD|"
80 INPUT #1 ,X(C ) ,Y(C> ,P(C )
90 NEXT C
100 FOR C = 1 TO 25
110 PRINT X( C ) ,Y< C >,P( C )
120 NEXT C
130 END
140 REM Check bit 2 for available digitized point
150 PRINT #1 ,“0Si"
160 INPUT #1 .STATUS
170 STATUS = INT(STATUS/4)
180 IF STATUS = INT(STATUS/2 )*2 THEN 150
190 RETURN
HP-IB Interrupts and Polling
A third method can be used by advanced programmers thoroughly
familiar with the HP-IB interface, polling techniques, and interrupts. It
should only be used when the computer can perform useful tasks while
waiting for the digitized point to be entered. This method involves
setting a value of 4 in the S-mask of the IM instruction, e.g., IM 223,4,0;
to cause the plotter to generate an RQS (service request) when a
digitized point is available. With an interrupt routine enabled for
service requests, the computer can send a DP instruction to initiate
digitizing, and then proceed with some other task until the digitized
point is entered. When the point is available, the computer is interrupted
by the RQS, and program execution branches to the routine to process
the digitized data. This routine could simply send an OD instruction
and read the digitized point, or it could perform bit checking of the
plotter status byte if multiple S-mask values have been specified to
generate the RQS. The status byte can be obtained by serial polling or
simply by sending an OS instruction. Because interrupts and polling
are highly machine-dependent and beyond the scope of this manual, no
examples are given.
DIGITIZING 6-7
Chapter
Obtaining Information
from the Plotter
What You’ll Learn in This Chapter
Up to this time we have mainly been concerned with sending informa¬
tion or data to the plotter. Sometimes, however, we want to know some¬
thing about the plotter, its current pen position, its status, whether an
error has occurred, or what capabilities the plotter has. In this chapter
you will learn about most of the plotter’s output instructions. The out¬
put PI and P2, the output window, and the output hard-clip limits
instructions are discussed in Chapter 2 and the output digitized point
instruction is discussed in Chapter 6. All other output instructions are
discussed in this chapter. The timing of output depends on your
interface (HP-IB or RS-232-C). Before using the output instructions, you
should have read the notes below and the appropriate interfacing
chapter in this manual.
HP-GL Instructions Covered
OA The Output Actual Position and Pen Status Instruction
OC The Output Commanded Position and Pen Status Instruction
OE The Output Error Instruction
OF The Output Factors Instruction
01 The Output Identification Instruction
00 The Output Options Instruction
OS The Output Status Instruction
Terms You Should Understand
Output Terminator — denoted in this manual as TERM — the ASCII
character or characters sent by the plotter at the end of a plotter re¬
sponse to an output instruction. With an HP-IB interface, the two
characters, carriage return and line feed, are the output terminator.
With an RS-232-C interface, the output terminator is a carriage return,
unless modified by an ESC . M command.
OBTAINING INFORMATION FROM THE PLOTTER 7-1
A Brief Word about Plotter Output
There are slight differences in the timing of output when the plotter is
used with the HP-IB or RS-232-C interfaces. Read the paragraph below mmmm
which pertains to your system.
Notes for an HP-IB User
When the 7475 has an HP-IB interface, the terminator for an output
statement, denoted TERM, is a carriage return followed by a line feed.
The output instructions in this chapter should not be used when the
plotter is in listen-only mode since the plotter in listen-only mode can¬
not output anything. Output instructions will be ignored by the plotter
so the computer will get no response to its read statement, and, typi-
cally, the program will halt.
A plotter with an HP-IB interface will respond only when the computer _
sends a read instruction (the plotter is instructed to talk). Therefore, a
read statement should directly follow any output instruction. When a
second output instruction is received before data from the first instruc- m
tion has been read, the new data overwrites the old data and the old
data is lost. Refer to Chapter 9 for more information.
Notes for an RS-232-C User
With an RS-232-C interface, the 7475’s terminator for an output state¬
ment, denoted TERM, is a carriage return, unless the terminator is ■—
modified by an ESC . M instruction. As soon as an output instruction
has been parsed by the plotter, output occurs according to the hand¬
shake protocol established by the ESC . M and ESC . N instructions. —
Use of turnaround delays, intercharacter delays, and an output initiator
should be specified as necessary to assure that output will not be lost
because the computer is not prepared to receive it. The information nec- —
essary to assure this should be contained in the documentation for your
computer. Refer to Chapter 10 of this manual for more information.
The Output Actual Position and
Pen Status Instruction, OA _
DESCRIPTION
The output actual position and pen status instruction,
OA, is used to output the X- and Y-coordinates and pen status (up or
down) associated with the actual pen position.
HK1 ¥i This instruction can be used to determine the pen’s current
position in plotter units. You might use that information to position a
label or figure, or determine the parameters of some desired window.
SYNTAX
OA terminator
7-2 OBTAINING INFORMATION FROM THE PLOTTER
EXPLANATION
Output is always in plotter units.
No parameters are used.
The pen position and status are output to the computer as integers in
ASCII in the form:
X,Y,P TERM
where X is always the X-coordinate in plotter units,
Y is always the Y-coordinate in plotter units,
P is the pen status (0 = pen up, 1 = pen down), and
TERM is the output terminator for the interface installed.
The ranges of the X- and Y-coordinates are the hard-clip limits deter¬
mined by the setting of the paper switches.
Hard-clip Limits
Paper Size
Hard-clip Limits
X-axis
Y-axis
A
10365
0 Y sS 7962
B
0sSX< 16640
0^Y^ 10365
A4
O^X^ 11040
0 sS Y sS 7721
A3
0 ^ X ^ 16158
0^Y^ 11040
No positive sign is output.
The Output Commanded Position and
Pen Status Instruction, OC
DESCRIPTION
The output commanded position and pen status instruc¬
tion, OC, is used to output the X- and Y-coordinates and pen status (up
or down) associated with the last valid pen position instruction.
Kfiai This instruction can be used to determine the pen’s last valid
commanded position in plotter units or user units depending on whether
scaling is off or on. You might use that information to position a label
or figure, or determine the parameters of an instruction which moved
the pen to the limits of some window.
OC terminator
SYNTAX
EXPLANATION
Output is in decimal format, in user units when scaling
is in effect, and in plotter units when scaling is off.
No parameters are used.
OBTAINING INFORMATION FROM THE PLOTTER 7-3
The pen position and status are output to the computer as decimal
numbers in ASCII in the form:
X,Y,P TERM
where X is always the X-coordinate in plotter units or user units,
Y is always the Y-coordinate in plotter units or user units,
P is the pen status (0 = pen up, 1 = pen down), and
TERM is the output terminator for the interface installed.
When scaling is off, X- and Y-coordinates are in plotter units. When
scaling is on, X- and Y-coordinates are in user units. Ranges of the
X-and Y-coordinates are —32 768 to 32 767 whether scaling is on or off.
When the commanded pen position is such that its user unit value
would be less than -32 768 or greater than 32 767, the output may not
represent the true pen position. If the plotter were scaled with the given
instructions as shown in the following illustration, all points in the
lightly shaded areas will have one coordinate as 32 767, the largest
number the plotter can output. All points in the darker shaded area will
have both coordinates as 32 767. One way to access this area is with the
AA instruction.
Instructions executed:
"IP 0,0,6000,3500; SC 0,32767,0,32767;"
OUTPUT.
X-PARAMETER, 32 767 , PEN STATUS
P2 6000,3500
PI 0,0
OUTPUT:
32 767 . Y-PARAMETER , PEN STATUS
7-4 OBTAINING INFORMATION FROM THE PLOTTER
The Output Error Instruction, OE
DESCRIPTION
The output error instruction, OE, is used to output the
decimal equivalent of the first HP-GL error (if any).
IIWM This instruction can be used to determine the type of the first
error. It is useful when debugging programs or to determine if all data
or instructions were accepted by the plotter.
BtlilliyJ OE terminator
No parameters are used.
When an OE instruction is received, the plotter converts the first HP-
GL error to a positive integer in ASCII, which is output in the form:
error number TERM
The error number is defined as follows:
Error
Number
Meaning
0
No error
1
Instruction not recognized
2
Wrong number of parameters
3
Out-of-range parameters
4
Not used
5
Unknown character set
6
Position overflow
7
Not used
8
Vector received while pinch wheels raised
TERM is the output terminator for the interface installed.
In an HP-IB system after the carriage return has been sent, and in an
RS-232-C system after the output is complete, bit position 5 of the status
byte is cleared (if set), and the ERROR LED (if lit) is turned off (unless
there is an RS-232-C error which has not been cleared by an ESC. E
instruction).
You should note that anytime the plotter receives an unpaired alpha¬
betic character, error 1 will be set. Thus, an alphabetic parameter or
three alphabetic characters in a row will generate error 1. When you
encounter error 1, look for a misplaced alphabetic character.
Once your plotting programs are debugged, you may want to remove
most output error instructions from your program to reduce your com¬
puter’s I/O operations and maximize plotting speed.
OBTAINING INFORMATION FROM THE PLOTTER 7-5
The Output Factors Instruction, OF
DESCRIPTION
The output factors instruction, OF, is used to output the
number of plotter units per millimetre in each axis.
HmM This instruction enables the plotter to be used with software
which must know the size of a plotter unit.
SYNTAX
OF terminator
No parameters are used.
The plotter will always output the following:
EXPLANATION
40,40 TERM
These factors indicate that there are approximately 40.2 plotter units
per millimetre in the X-axis and in the Y-axis (0.025 mm/plotter unit).
TERM is the output terminator for the interface installed.
The Output Identification Instruction, OI
DESCRIPTION
The output identification instruction, OI, is used to out¬
put a plotter identifier.
lIRiyi This instruction is especially useful in a remote operating en¬
vironment to determine which model plotter is on-line.
SYNTAX
EXPLANATION
OI terminator
No parameters are used.
The plotter will always output the following character string:
7475A TERM
TERM is the output terminator for the interface installed.
The Output Options Instruction, OO
DESCRIPTION
The output options instruction, OO, is used to output
eight option parameters.
This instruction is especially useful in a remote operating en¬
vironment to determine which options are available in the plotter
which is on-line.
SYNTAXjrj
EXPLANATION
terminator
No parameters are used.
7-6 OBTAINING INFORMATION FROM THE PLOTTER
The plotter will always output the appropriate combination of eight
integers in ASCII, separated by commas. The options included in the
plotter are indicated by a 1 as defined below.
0,1,0,0,1,0,0,0 TERM
t-lndicates arcs and circle instructions are included.
-Indicates pen select capability is included.
TERM is the output terminator for the interface installed.
The Output Status Instruction, OS
DESCRIPTION
The output status instruction, OS, is used to output the
decimal equivalent of the status byte.
HKi*i This instruction is useful in debugging operations and in
digitizing applications.
OS terminator
No parameters are used.
SYNTAX
EXPLANATION
Upon receipt of the OS instruction, the internal eight-bit status byte is
converted to an integer between 0 and 255. Output is in ASCII in the
form:
status TERM
OBTAINING INFORMATION FROM THE PLOTTER 7-7
The status bits are defined as follows:
Bit
Value
Bit
Position
Meaning
1
0
Pen down.
2
1
PI or P2 changed; cleared by reading
output of OP in HP-IB system or by
actual output of P1,P2 in RS-232-C
system, or by IN instruction.
4
2
Digitized point available; cleared by
reading digitized value in HP-IB system
or by output of point in RS-232-C
system, or by IN instruction.
8
3
Initialized; cleared by reading OS output
in HP-IB system or by output of the
status byte in RS-232-C system.
16
4
Ready for data; pinch wheels down.
32
5
Error; cleared by reading OE output in
HP-IB system or by output of the error
in RS-232-C system, or by IN
instruction.
64
6
Require service message set (always 0
for OS; 0 or 1 for HP-IB serial poll).
128
7
Not used
Upon power up, the status is decimal 24, the sum of 8 (initialized) and
16 (ready for data). Upon output of the status byte after an OS
instruction, bit position 3 is cleared.
7-8 OBTAINING INFORMATION FROM THE PLOTTER
Summary of Output Response Types
The following table shows the number and type of items in the re¬
sponse to each HP-GL output instruction. The table includes output
instructions explained in Chapters 2 and 6 as well as in this chapter.
This table will be helpful when programming in languages such as
FORTRAN which require you to specify the type of and number of
digits in a variable.
Instruction
Number of
Parameters
Returned*
Type and Range
OA
3
integers, all ^ 5 digits
OC
3
maximum 5 digits in integer
portion,
maximum 4 digits in fractional
portion (sign and decimal point
optional)
OD
3
integers, all < 5 digits
OE
1
integer, 1 digit
OF
2
integers, 2 digits each
01
1
5-character string
00
8
integers, 1 digit each
OP
4
integers, all < 5 digits
OS
1
integer, ^ 3 digits
OW
4
integers, all ^ 5 digits
*In addition to these parameters, the output terminator TERM is always sent
at the end of output, and commas are sent to separate parameters.
OBTAINING INFORMATION FROM THE PLOTTER 7-9
Chapter
Putting the Instructions
to Work
What libu’ll Learn in This Chapter
In this chapter you’ll learn how to put instructions together to develop
a plot. The following examples are designed to show you how to
integrate many instructions into a complete program, how data might
be handled, and how subroutines are used to program a task that is
common to many plots and could be used in several programs.
Remember that these programs are written in Microsoft® BASIC. They
use techniques such as FOR... NEXT loops and subroutines to read
data and draw plots. If necessary, check your computer documentation
for the correct methods of implementing these techniques.
The first program draws a line chart, one of the most common types of
plots. You can use line charts to plot almost any kind of data — sales
data, factory output, sales volume, data from laboratory experiments,
population trends, etc. The concepts of plotting and labeling demon¬
strated here can be used in almost any application.
The second program draws a stacked bar chart; the third program
draws a pie chart. The sales data are differentiated in bars or wedges
by solid fill, cross-hatching and parallel hatching. The programs
demonstrate how to define fill types and how to fill and outline
rectangles and wedges.
The first program is explained in detail, and is organized to show you
how to develop a program. The second two programs are explained
more briefly, because the concepts of developing these programs are
similar to developing the line chart.
NOTE: Some computers use an Xon-Xoff handshake to prevent buffer
overflow and data loss. ■
To set up an Xon-Xoff handshake, insert the following lines in your
program after the configuration statement. (For more information, refer
to the ESC . I and ESC . N instructions in Chapter 9.)
PUTTING THE INSTRUCTIONS TO WORK 8-1
PRINT #1 , CHR$(27 ) i“.I 81;;1V:
PRINT #1, CHR$(27 ) j".N;19:"
Line Chart
For this line chart, you will scale, draw, and label an X- and Y-axis and
plot 1985 sales by region. The following paragraphs develop segments
of the program in a logical sequence. The complete plot and program
are shown later in the section titled Program listing.
Setup and Scaling
For emphasis and readability, you should draw the title and important
data with wide pens. Narrow pens are usually sufficient for axes and
labels. For this line chart, the suggested pen order for the carousel is:
1 = black, P.3
2 = black, P.7
3 = red, P.3
4 = blue, P.3
5 = green, P.3
6 = aqua, P.3
7 — unused
8 — unused
Begin your program with the appropriate configuration statement for
your computer. Then, using the IN or DF instruction, set the plotter to
known conditions and cancel any parameters that may have been set
in a previous program. IN is used here to be sure all conditions (such as
P1/P2 settings) are set to a default state.
Select a pen (SP 1;) and establish scaling points for this plot. The
parameters of the IP instruction determine the location of the scaling
points, PI and P2. The location of these points provides a convenient
area for the scale, which is assigned in the scaling statement
SC 1,12,0,150;. Since this chart shows one year’s sales by month, the
X-axis (commonly representing time) is scaled from 1 to 12. The Y-axis
is scaled in thousands from 0 to 150 so that all sales data will fall
inside this range. Labels and titles will be placed outside this area.
You will either need to know the range of your data or be willing to try
some plots with different scales to determine what your scale statement
should be. Thousands or millions of dollars are common scales.
Once the scale is established, draw a frame for the data area. Here
PU 1,0; moves the pen to the first point with the pen up. The pen is
then lowered and connects the four comers.
The first three program lines to accomplish the above are:
20 PRINT#!, "INsSPI;IP1250,750,9250,6250;"
30 PRINT #1 , "SCI ,12 ,0,150;"
40 PRINT #1, "PU1 ,0;PD 12 ,0,12,150,1 ,150,1 ,0;PU;
8-2 PUTTING THE INSTRUCTIONS TO WORK
The Axes and Their Labels
You are now ready to draw and label the axes. The absolute label size
instruction, SI 0.2, 0.3;, creates characters slightly larger than the
default character size. The tick length is established by the instruction
TL 1.5,0;. The resulting ticks will be 1.5% of the horizontal or vertical
distances between scaling points.
This program uses a FOR... NEXT loop to draw the axes. For the
X-axis, let X range from 1 to 12 to represent 12 months of data. The
loop does four things: moves to the integer location on the X-axis,
draws a tick mark, establishes the label origin, and draws the label.
Note that the X-parameter of the plotting instruction is a variable. If
you do not know how to send a variable to the plotter, consult your
computer’s documentation and Plotting with Variables in Chapter 3.
Since the XT instruction draws a tick whether the current pen status is
up or down, be sure the pen is up to avoid unwanted lines between the
ticks, labels, and axis.
Place the labels in a DATA statement in order to use the looping
technique for labeling axes. (At some point, you might want to access
data for the latest 12 months. If your data were stored with a data code,
you could use a similar technique to read the labels and data from a file
and properly label your chart for the data you were then plotting.) Then
access the labels with a string variable in the LB instruction. Refer to
Labeling with Variables in Chapter 5 for hints on sending variables in
labels.
To position the labels, the program uses the CP instruction to center
the label under the tick. By moving one-third character space back and
one line down, the single character label is centered under the tick with
enough space to be easily read. Finally, the axis title, Calendar Month,
is centered and drawn under the axis.
The following lines contain the statements that perform the functions
just described.
50
PRINT #1,
" S1.2,.3!TL1.5,0;"
60
FOR X = 1
TO 12
70
PRINT #
1 , “PA";X;",0;XT; “
80
READ A$
90
PRINT #
1, "CP-.33,-1;LB"+A$+CHR$(3 )
100
NEXT X
1 10
PRINT #1,
“PA6.5,0;CP-7 ,-2.5;"
120
PRINT #1,
“LBCalendar Month"+CHR$(3 )
500
DATA "J",
“F“,"M“,"A"."M" ."J"
510
DATA “J“,
"A“,"S”, M 0"."N" , "D“
PUTTING THE INSTRUCTION TO WORK 8-3
The Y-axis is created in a similar manner, except that the program uses
the loop’s index for the label value and two different CP instructions
for labels of three digits and labels of less than three digits.
The lines which draw the Y-axis and label it follow.
130
FOR Y=0
TO
150 STEP 25
140
PRINT
#1
, "PA1 , “5 Y;“;YT ; “
150
IF Y<100
THEN PRINT #1 , “CP-3,-.25
160
IF Y>99
THEN PRINT #1 , "CP-4 ,-.25;
170
PRINT
#1
, “LB";Y;CHR$(3 )
180
NEXT Y
190
PRINT #1
j
“PA1 ,150;CP-3.5,2; "
200
PRINT #1
7
“LBSales $“+CHR$(3 )+"CP-9 ,
210
PRINT #1
7
“LB(Thousands )“+CHR$<3)
Change to a wide pen to plot the title. Next, move to the top center of
the chart, increase the character size, and label the chart title.
The program lines that title the chart are:
220 PRINT # 1 , “SP2;PA6,150;SI.4,.6;CP-9.5,2;“
230 PRINT # 1 , "LB1985 Sales by Region“+CHR$<3>
Here’s what the chart looks like so far.
1985 Sales by Region
Sales $
(Thousands)
150 .-
125 -
100 -
75 -
50 -
25 -
JFMAMJJASOND
Calendar Month
8-4 PUTTING THE INSTRUCTIONS TO WORK
Plotting the Data
You are now ready to draw lines. The first data line is drawn with
parameters included when the program was written. Therefore, if the
data changes, it will be necessary to change the plot instructions in the
program.
The first line is drawn with pen 6 using the default solid line type. After
drawing the line, the pen moves (up) to an area appropriate for
labeling. After the character size is changed to match that used to label
the axes, the plotter labels “South America.” Actually, each of the data
line’s labels were inserted near the end of the creation process and
involved trial and error to achieve satisfactory placement. Each label is
drawn after each line of data is plotted.
The program lines which plot the lowest line and the corresponding
label are:
240 PRINT #1, " SP6;LT;PA 1 ,23;PD2 ,25,3,18,4,22;“
250 PRINT fl , ”PD5,23,6,27,7,27,8,25,9,24,10,28!"
250 PRINT #1, -PD11 ,27,12,27, ;PU3.6,16;"
270 PRINT #1, -SI.2,.3jLBSouth America“+CHR$(3 )
The program plots the three remaining lines from data read at execution,
time using nested FOR... NEXT loops and a READ statement. You
can use this technique to plot a chart that will be replotted often with
new data. If the necessary file statements were added, the data could be
on a tape or disk file instead of in a DATA statement as shown here.
The first FOR ... NEXT loop beginning in line 280 runs 3 times, once
for each of the remaining data lines. With each loop sequence, a new
pen color and line type (3, 4,5) are selected in line 290.
In line 300 the second FOR... NEXT loop begins. It runs 12 times to
read each of the 12 values in the DATA statement and draw to each
point. As with the first data line, the corresponding label is drawn
(lines 340-360) after each line is plotted.
NOTE: Since this program uses variables as plot parameters, be sure
they are sent to the plotter with a valid separator between them. Here,
a comma has been inserted between variables to ensure that they are
separated, even though many systems do not require this. Computers
often send a leading and/or trailing blank space, or allow for a sign
space before numeric variables. The plotter will treat a blank, comma,
or a plus or minus sign as a separator between numeric parameters.
Know your computer before sending variables with plot instructions. ■
The loops that draw the remaining three chart lines and the corre¬
sponding data statements follow. Although 340-360 are each printed on
PUTTING THE INSTRUCTIONS TO WORK 8-5
two lines to fit on this page, send them to the plotter as one continuous
string.
280
FOR 1=1 TO 3
290
PRINT #1, "SP";I+2;“;LT“;I+2s";"
300
FOR X = 1 TO 12
310
READ Y
320
PRINT #1 , “PA" 5 X;",
”;Y;"PD; "
330
NEXT X
340
IF 1 = 1 THEN PRINT #1 ,
"PU4,45;LBJapan“
+CHR$(3 )
350
IF 1=2 THEN PRINT # 1 ,
"PU2 ,64iLBEurope"
+CHR$(3)
3G0
IF 1=3 THEN PRINT #1 ,
”PU2,107;LBUnited
States"+CHR$(3 )
370
NEXT I
380
PRINT #1 , “SP0!“
500
DATA "J “ ,"F" , “H", “ A “,"M
" »“ J"
510
DATA " J" ," A'' , “ S ” ."0" , "N
" ," 0 “
520
DATA 45 ,50 ,52,53,52.51 ,55 ,56 ,56 ,58 ,58 ,60
530
DATA 55 ,60 ,63 ,62,59,54,50,46,47,49,53,58
540
DATA 98,100,102,105,107
550
DATA 1 10,125,1 12,1 15
5G0
DATA 125,130,122,0,0
570
END
Program Listing
A reduced version of the plot is shown next, followed by a complete
listing of the program. Line 10 must include the proper configuration
instructions necessary to establish interface conditions. You might
need to make changes for your computer’s BASIC. Or, you can use
another programming language and send the HP-GL instructions using
that language’s output and looping techniques.
8-6 PUTTING THE INSTRUCTIONS TO WORK
1985 Sales by Region
Sales $
(Thousands)
10
OPEN "com :
9600 ,N ,8,1 ,RS ,CS65535 ,DS ,CD" AS
20
PRINT #1,
"INiSPl;IP 1250,750,9250,6250;"
30
PRINT #1 ,
"SCI ,12,0,150;“
40
PRINT #1 ,
"PUl ,0;PD12,0,12,150,1 ,150,1 ,0;f
50
PRINT #1 ,
"SI.2 ,.3;TL1.5,0;“
60
FOR X = 1
TO 12
70
PRINT #1
, “PA";X;" , 0;X T ; "
80
READ A$
90
PRINT #1
, "CP-.33,-1;LB“+A$+CHR$(3)
100
NEXT X
1 10
PRINT fl,
"PA6.5,0;CP-7,-2.5;“
120
PRINT #1,
"LBCalendar Month"+CHR$(3 )
130
FOR Y=0 TO
150 STEP 25
140
PRINT #1
, "PA 1 ,";Y;";YT; "
150
IF Y<100
THEN PRINT #1 , "CP-3,-.25;"
160
IF Y>99
THEN PRINT #1 , “CP-4 ,-.25; "
170
PRINT #1
, "LB";Y;CHR$(3 )
180
NEXT Y
190
PRINT #1 ,
"PA1 ,150;CP-3.5,2;"
200
PRINT #1 ,
“LBSales $“+CHR$< 3 )+"CP-9 ,-1;“
210
PRINT #1 ,
"LB(Thousands>"+CHR$<3)
220
PRINT #1 ,
“SP2;PA6,150;S1.4 ,.6;CP-9.5 ,2; “
230
PRINT #1 ,
'*LB 1 985 Sales by Region"+CHR$( 3
240
PRINT #1 ,
”SP6;LT;PA 1 ,23;PD2 ,25 ,3,18,4 ,22
PUTTING THE INSTRUCTIONS TO WORK 8-7
250 PRINT #1 . "PD5,23,6,27,7,27,8,25,9,24,10,28;"
260 PRINT#!, "PD 11 ,27,12,27,;PU3.6,16;"
270 PRINT #1, "SI.2 , .3;LBSouth America"+CHR$(3>
280 FOR 1=1 TO 3
290 PRINT *1 , "SP";I+2;";LT";I+2;"; “
300 FOR X = 1 TO 12
310 READ Y
320 PRINT #1, “PA“;X;",“;Y;“PD;“
330 NEXT X
340 IF 1=1 THEN PRINT #1, “PU4,45;LBJapan"
+CHR$<3)
350 IF 1=2 THEN PRINT #1, “PU2 ,64;LBEurope"
+CHRS<3)
360 IF 1=3 THEN PRINT #1, "PU2,107;LBUnited
States"+CHR$(3)
370 NEXT I
380 PRINT #1 , “SP0;"
500 DATA "J" ,"F" ,"M" ,“A","M" ,"J"
510 DATA "J" , “A“ , “S" ,"0",“N“,"D“
520 DATA 45 ,50 ,52,53 ,52.51 ,55 ,56 ,56 ,58,58 ,60
530 DATA 55,60,63,62,59,54,50,46,47,49,53,58
540 DATA 98,100,102,105,107
550 DATA 110,125,112,115
560 DATA 125,130,122,0,0
570 END
Bar Graphs and Pie Charts
Filling and Hatching
Two kinds of area fill are commonly used in bar graphs and pie charts;
solid fill and hatching. Solid fill totally covers the area with color,
whereas hatching fills the area with evenly spaced parallel lines. If
there are lines in two directions at 90-degree angles, we call the
hatching crosshatching. Sometimes a graph will have both narrow and
wide hatching or crosshatching, the wide hatching having more space
between the lines than the narrow.
Producing a Bar Graph
Scaling the Axes
In the following bar graph titled “Sales Volume by Region,” we are
plotting sales over a three-year period. For readability, the X-axis is
scaled to provide a comfortable margin of space before and after each
bar. The Y-axis is scaled from 0 to 500 to represent sales in thousands
of dollars.
8-8 PUTTING THE INSTRUCTIONS TO WORK
Plotting the Title
The title and axes are drawn with a wide pen (stored in stall two) for
emphasis. The title is drawn first, with characters that are a little more
than twice the default size. All labels are centered and offset slightly
from the data area with the CP instruction.
Labeling the Axes
The bars on the X-axis are labeled without tick marks, using a narrow
pen and characters that are slightly larger than default size. The Y-
axis is labeled with tick marks and an extra label to show the scaling
used (K$).
Labeling the Bar Segments
The data for labeling each bar segment is input using read and data
statements. This approach allows easy modification of the label data.
Each segment label is centered next to the rightmost bar by computing
a Y-axis position that is equal to the height of the prior segments plus
one-half the height of the current segment.
Filling and Edging Each Segment
The data for each bar segment is stored in a three by three array. Each
array element contains the height of a segment with respect to the Y-
axis scaling. The bars are drawn from bottom to top using the FT, RA,
and EA instructions to define, fill, and edge each stacked rectangular
segment. Wide pens are used in stalls 3, 4, and 5 of the carousel for
filling the bars.
Completion of Bar Graph
At the completion of the program, the scaling points are reset to their
default location, the pen is raised and put away, and the finished plot is
presented for viewing.
PUTTING THE INSTRUCTIONS TO WORK 8-9
Sales Volume by Region
10 REM Generalized bar chart
20 REM
30 REM Place chart and label data in arrays
40 REM with lower bounds of 1.
50 OPTION BASE I
60 DIM L$< 80),B(3 ,3 )
70 REM
80 DATA United States.South America .Europe
90 DATA 144.177,196,71,101,147.30.75,104
100 READ L$< I ) ,L$(2 ) ,L$(3 )
110 FOR I = 1 TO 3
120 FOR J = 1 TO 3
130 READ B<I , J )
140 NEXT J
150 NEXT I
160 REM Configuration statement
170 OPEN "C0M1:9600,N,8,1 ,RS .CS65535 ,DS ,CD“ AS #1
180 REM Initialize plotter; set scaling points P1.P2
190 REM Scale axes
200 PRINT #1, “ IN; IP 1 000,1000 ,9000 ,6750; 11
210 PRINT #1, “SCI 981 ,1985,0,500;”
(Program listing continued)
8-10 PUTTING THE INSTRUCTIONS TO WORK
220 REM Label title using thick pen
230 REM then draw axes
240 PRINT #1, "PU;SP2;PA1983.3,500;SI.4,.6;CP-1 0,1.2;"
250 PRINT #1, “LBSales Volume by Region"+CHR$(3>
260 PRINT #1, ”PU;PA1981.3,500;PD;PA1981.3,0,1985.3,0?
270 REM Select narrow pen; reset character size.
280 REM Set tick length; then label axis.
290 PRINT #1 , "PU;SP1 ;SI. 2 ,.3; TL1 .5,0;'*
300 FOR X=1982 TO 1984
310 PRINT #1 , "PA";X;“,0;CP-2.8,-1;LB";X;CHR$< 3 )
320 NEXT X
330 REM Add ticks and then labels to the Y-axis.
340 FOR Y= 0 TO 500 STEP 100
350 PRINT #1, "PA 1981.3,";Y;";YT;"
360 IF Y=0 THEN PRINT #1, "CP-2.5 ,-. 25; “
370 IF YO0 THEN PRINT #1, "CP-4.5 ,-.25;"
380 PRINT #1, "LB";Y;CHR$(3 )
390 NEXT Y
400 PRINT #1, "PA1981.3,510;LBSales <K$>“+CHR$<3>
410 REM Center segment labels using prior height
420 REM plus one-half current height.
430 FOR 1=1 TO 3
440 Y=0
450 FOR J=1 TO 1-1
460 Y=Y+B(J ,3 )
470 NEXT J
480 Y=Y+B(I ,3 )/2
490 PRINT #1 , "PA1984.4,";Y;"; "
500 PRINT #1, "CP0,-.25;LB"+L$<I)+CHR$< 3 )
510 NEXT I
520 REM Draw and fill each bar using wide pens.
530 FOR 1=1 TO 3
540 PRINT #1, “SP";1+2;";PT.7;“
550 K=1
560 FOR X=1982 TO 1984
570 Y1=0
580 REM Compute Y-axis start point
590 REM for each bar segment.
600 FOR J=1 TO I-l
610 Y1=Y1+B(J ,K )
620 NEXT J
630 REM Compute Y-axis end point
640 REM for each bar segment.
650 Y2=Y1+B(J ,K >
660 K=K+1
670 REM Select fill type.
PUTTING THE INSTRUCTIONS TO WORK 8-11
680
IF 1=1 THEN PRINT #1
, “FT1 i"
690
IF 1=2 THEN PRINT #1
, "FT4 , .05 ,45 5 “
700
IF 1=3 THEN PRINT #1
, "FT3,.05,45;"
710
REM Move to start point
for segment;
720
REM then fill and outline defined bar area
730
PRINT tl , "PA"iX-.3;
‘ , " 5 V 1 5 “ 5 "
740
PRINT #1, "RA";X+.3;
•i •• . \yn . H . u
, » T £ » »
750
760
770
PRINT #1, "EA";X+.3;
NEXT X
NEXT I
, i»
780 REM Put pen away and end
790 PRINT #1, "SP0;"
800 END
Producing a Pie Chart
program .
Overview
In the following pie chart titled “Sales Dollar Distribution,” we are
plotting the distribution of sales dollars among four groups: R&D,
Administration, Marketing, and Manufacturing. Pie charts easily con¬
vey information concerning parts of a whole. Since we can easily break
up the whole sales-dollar-distribution picture into four parts, the pie
chart is an appropriate choice for presenting this information. For ease
of understanding, pie charts ought not to be broken into less than three
or more than six parts.
Inputting the Data
In the loop beginning at line 110, we input the start, mid-point, and
stop angle for each segment using read and data statements. In line
155, the pie segment labels are read into arrays.
Plotting the Title
So that the pie chart will be centered, PI and P2 are repositioned with
the IP instruction and the plotting area is scaled so that 0,0 is near the
center of the page. The title is centered with the CP instruction, the
character size is set to 0.4 cm wide and 0.6 cm high with the SI
instruction, and a wide pen is selected with the SP instruction.
Plotting the Labels
Lines 220 through 340 label each segment using the data previously
stored in line 90. For readability, the labels are drawn with a narrow
pen and with a character size that is smaller than the one used for the
title. The labels are centered and offset from the appropriate segment
with the CP instruction. We increase the distance used to position the
label for segment 2, since the second segment is exploded.
8-12 PUTTING THE INSTRUCTIONS TO WORK
Filling and Edging Each Segment
In the next loop beginning at line 360, a wide pen and a fill type are
selected for each segment with the SP and FT instructions. Lines 400
and 410 adjust the center point for the exploded segment. The sweep
angle for each segment is then computed (sweep angle = stop angle
— start angle), and the segments are filled and outlined with the WG
and EW instructions.
Completion of Pie Chart
At the completion of the program, the scaling points are reset to their
default location, the pen is raised and put away, and the finished plot is
presented for viewing.
Sales Dollar Distribution
RGD
Marketing
Administration
Manufacturing
10 OPEN "COMI:9600,N,3,1 ,RS ,CS65S35,DS,CD M AS 1 1
20 REM Pie Chart
30 REM Place chart and label data in arrays
40 REM with lower bounds of 1
50 OPTION BASE 1
60 DIM W$(4),P(4,3)
70 DATA 0,21 .5,43,43,80.5,1 18,1 18,166.5
(Program listing continued)
PUTTING THE INSTRUCTIONS TO WORK 8-13
80 DATA 215,215,287,360
90 DATA Administration, R&O .Marketing .Manufacturi
100 DATA Manufacturing
110 REM Read start, mid-point, and stop angle
120 REM for each segment. Then read labels.
130 FOR I = 1 TO 4
140 FOR J = 1 TO 3
150 READ P(I , J )
160 NEXT J
170 NEXT I
180 READ W$(1 ) ,W$<2 ) ,W$<3 ) ,W$(4 )
190 REM Initialize plotter; set scaling points
200 REM PI and P2; scale the chart.
210 PRINT #1 ,"IN;IP2250,500,8250,7100; "
220 PRINT #1 , "SC-10,10,-10,12; "
230 REM Label title using wide pen, large letters.
240 PRINT #1 ,"SP2;PA0,12;SI.4,.6;CP-12.34,0;"
250 PRINT #1,"LBSales Dollar Distribution"+CHR$(3 )
260 REM Label each wedge using narrow pen and
270 REM small letters.
280 PRINT #1 ,"SP1;S1.2 , .3;"
290 REM Set PI variable to convert from
300 REM radians to degrees.
310 PI=3.141593
320 FOR I = 1 TO 4
330 REM Move to center arc.
340 R = 8
350 IF 1=2 THEN R=9
360 X=R*C0S(P<I ,2 )*< PI/180 ) )
370 Y=R*SIN(P(I,2)*(PI/180 ) >
380 PRINT #1 , “PA";X;“ ,";Y; “; "
390 REM Determine label origin ; draw label
400 L = LEN (W$(I ))
410 IF I = 1 THEN PRINT #1 , “CP0 .25 ; “
420 IF I = 3 THEN PRINT #1 , "CP";-L;“-.25;"
430 IF I = 4 THEN PRINT #1 , "CP0 ,-.5;”
440 PRINT #1 ,"LB“+U$(I )+CHR$(3)
450 NEXT I
460 REM Draw and fill the wedges using pens 3-6
470 FOR I = 1 TO 4
480 PRINT #1 ,"SP";1+2;";PT.7; ”
490 X=0
500 Y=0
510 IF I = 2 THEN X=C0S(P(I ,2 )*(PI/180>)
520 IF I = 2 THEN Y=SIN( P<I ,2 )*<PI/180 ) )
530 IF I = 1 THEN PRINT #1,"FT1;"
8-14 PUTTING THE INSTRUCTIONS TO WORK
540
IF I = 2 THEN PRINT #1
,"FT3,.3 ,45;"
550
IF I = 3 THEN PRINT #1
,"FT4,.6 ,45;"
5G0
IF I = 4 THEN PRINT #1
,“FT3,.G,45; "
570
REM Compute the sweep
angle
580
S=P(I ,3 )-P(I , 1 )
590
REM Fill the wedge.
G00
PRINT #1 ."PA";X;";Yi
II m II
f
G 10
PRINT #1 , “WG7.5 ,";P(I ,
1 ); “ ,"; S; “;"
620
REM Outline the wedge.
G30
PRINT #1 , "EW7.5 , “ ;P(I ,
1 S”
G40
NEXT I
G50
REM Put pen away and end
program
GG0
PRINT #1 , "SP0;"
670
END
PUTTING THE INSTRUCTIONS TO WORK 8-15
Chapter
HP-IB Interfacing
What You’ll Learn in This Chapter
This chapter is only for 7475 owners with an HP-IB interface. HP 7475s
with Option 002 have an HP-IB interface.
In this chapter you’ll learn how to operate your plotter when it is con¬
nected to a computer using the Hewlett-Packard Interface Bus (HP-IB),
which conforms to ANSI/IEEE 488-1978 specifications. This chapter
defines the 7475’s implementation of the bus. Also included are address¬
ing the 7475, the listen-only mode, reaction to bus clear commands,
serial and parallel polling, addressing the 7475 as a talker or listener,
and examples of sending and receiving data using a variety of
computers.
This chapter assumes you have a working knowledge of the HP-IB;
however, if you wish to refresh your memory on HP-IB structure, refer
to Appendix A of this manual, entitled An HP-IB Overview.
HP-IB INTERFACING 9-1
HP-IB Implementation on the 7475
The HP-IB conforms to ANSI/IEEE 488-1978 specifications, and direct
interconnection of the HP-IB is via a connector on the rear panel.
The HP-IB functions implemented in the 7475 are as follows:
1. Source Handshake (SHI)
2. Acceptor Handshake (AH1)
3. Talker (T6)
4. listener (L3)
5. Service Request (SRI)
6. No Remote Local (RLO)
7. Parallel Poll (PPO if listen-only; PP2 if addr <8; PP1 otherwise)
8 Device Clear (DC1)
9. No Device TVigger (DTO)
10. No Controller (CO)
Interface Switches and Controls
The 7475 plotter functions in either of two modes, addressable mode
and listen-only mode. In addressable mode, the plotter can function as
a talker or as a listener depending on the instructions it receives from
the controller. In listen-only mode, it can only listen and it hears all
activity on the bus.
Addressing the Plotter
Rear panel switches provide for selection of the plotter address or listen-
only mode. Each HP-IB interface can have as many as 15 devices con¬
nected to it, set to different specific address codes. The plotter can be set
to any one of 31 HP-IB addresses, ranging from 0 through 30. Each
address can be selected by setting the switches on the rear panel to the
appropriate binary bit positions for the particular address value desired.
The address selected establishes the 7475’s device address. When using
the plotter with an HP desktop computer, do not use 21 which is
reserved for the desktop computer’s address. When not using an HP
desktop computer, be sure the computer and plotter do not have the
same address. (Refer to the documentation for your computer.) Address
31 is used to set the plotter to listen-only mode.
The plotter is set to an address code of 05 at the factory. This corres¬
ponds to a listen character of % and a talk character of E. Check the
following figure for the factory-set address switch positions.
9-2 HP-IB INTERFACING
1
1
FACTORY SET
ADDRESS OF 5
16 8
4 2
T
'o
The following table lists the address switch positions for each address
value.
Address
Address Switch
Characters
Settings
Address Codes
Listen
Talk
16
8
4
2
1
Decimal
Octal
SP
@
0
0
0
0
0
0
0
I
A
0
0
0
0
1
1
1
“
B
0
0
0
1
0
2
2
#
C
0
0
0
1
1
3
3
$
D
0
0
1
0
0
4
4
%
E
0
0
1
0
1
5
5 -
&
F
0
0
1
1
0
6
6
>
G
0
0
1
1
1
7
7
(
H
0
1
0
0
0
8
10
>
I
0
1
0
0
1
9
11
*
J
0
1
0
1
0
10
12
+
K
0
1
0
1
1
11
13
,
L
0
1
1
0
0
12
14
-
M
0
1
1
0
1
13
15
N
0
1
1
1
0
14
16
/
0
0
1
1
1
1
15
17
0
P
1
0
0
0
0
16
20
1
Q
1
0
0
0
1
17
21
2
R
1
0
0
1
0
18
22
3
S
1
0
0
1
1
19
23
4
T
1
0
1
0
0
20
24
i i
U
L J
U
1
0
1
0
1
21
:»
6
V
1
0
1
1
0
22
26
7
W
1
0
1
1
1
23
27
8
X
1
1
0
0
0
24
30
9
Y
1
1
0
0
1
25
31
Z
1
1
0
1
0
26
32
[
1
1
0
1
1
27
33
<
\
1
1
1
0
0
28
34
=
]
1
1
1
0
1
29
35
>
A
1
1
1
1
0
30
36
i i
i c. i
L J
-
1
1
1
1
1
31
37j-
preset
Reserved for
HP Desktop
Computer
Address
Sets Listen-
only Mode
HP-IB INTERFACING 9-3
Bus Commands
Reaction to Bus Commands DCL, SDC, and IFC
The computer can set all devices on the HP-IB system to a predefined
or initialized state by sending the device clear command, DCL. The
computer can also set selected devices to a predefined or initialized
state by sending a selected device clear command, SDC, along with the
addresses of the devices. The basic difference is that devices will obey
SDC only if they are addressed to listen, whereas DCL clears all de¬
vices on the bus. The interface clear command, IFC, is used by the
computer to override all bus operations and return the bus to a known
quiescent state.
Upon receipt of either a DCL, SDC, or IFC command, the plotter resets
the I/O to begin accepting a new instruction, and disables any current
output. Any partially parsed HP-GL instruction or parameters will be
lost.
The device clear and interface clear commands do not reset parameters
in the plotter to their default values. They are not the same as the
HP-GL instructions, DF or IN.
Serial and Parallel Polling
Polling is the process used by the computer to determine which device
on the HP-IB bus has initiated a require service message. The condi¬
tions which will cause the require service message to be sent to the
computer are defined by the input mask instruction, IM, in Chapter 1.
The Serial Poll
A serial poll enables the computer to learn the status or condition of
devices on the bus. It is commonly used by the computer to determine
who is requiring service.
The serial poll is so named because the computer polls devices one at a
time rather than all at once. The plotter will respond to a serial poll by
sending the status byte as described under the output status instruction,
OS (Chapter 7). The S-mask parameter of the input mask instruction,
IM, is used to specify which status byte conditions will send the service
request message and when polled, respond with request service. Unless
the user changes the S-mask value from the default setting of 0, the
plotter will never give a positive response to a serial poll, i.e., request
service (see The Input Mask Instruction, IM, Chapter 1). Bit position 6
of the status byte will be set to 1 (if the S-mask value is not 0) when any
of the conditions designated by the S-mask are true. Bit position 6 will
be set to 0 after all conditions which would cause a service request no
longer exist. See IM, Chapter 1, and OS, Chapter 7. Until bit position 6
has been reset to 0, no additional service request messages, and there¬
fore, no responses to a serial poll are possible.
9-4 HP-IB INTERFACING
A computer must issue special commands to initiate and terminate a
serial poll. During a serial poll, a device must be instructed to talk and
the computer to listen. Therefore, a serial poll cannot be executed when
a plotter is in listen-only mode.
The Parallel Poll
Parallel polling can only be done to plotters with an address 0 through
7. Plotters with address settings from 8 through 30 cannot respond to a
parallel poll. The plotter will respond positively to a parallel poll only if
the conditions specified in the P-mask are satisfied and parallel poll
response is enabled. The P-mask parameter of the input mask instruc¬
tion, IM, is used to specify which status byte conditions will result in a
logical 1 response to a parallel poll. The response to a parallel poll is
limited to setting the appropriate data line to a logical 1. The line used
is determined by the plotter’s address value as shown in the table below:
Plotter
Address
Parallel Poll
Bit Position
HP-IB Data
Line Number
0
7
8
1
6
7
2
5
6
3
4
5
4
3
4
5
2
3
6
1
2
7
0
1
Plotter Preset Address
To execute a parallel poll, the controller sets the ATN and EOI lines
to 1. The controller reads the eight data lines, and determines from
these lines which instrument on the bus is requesting service. The com¬
puter then sends the parallel poll disable command. Not all computers
have parallel poll capability.
It is important to remember that the 7475 will not send a logical 1
unless the P-mask bit value has been changed from the default value of
0 and some condition included in the new P-mask value is true. The
plotter does not respond to a parallel poll in listen-only mode.
Positive responses to parallel polls will continue to occur until all bits of
the status byte included in the P-mask value have been reset to 0. (See
The Output Status Instruction, OS, Chapter 7.)
HP-IB INTERFACING 9-5
Addressing the 7475 as a Talker
or Listener
To communicate effectively with the 7475 plotter, it is important
that you completely understand the addressing protocol of your com¬
puter. Therefore, you may wish to review this aspect of your computer
before proceeding.
Computers with No High Level I/O Statements
On low level computers, addressing devices on the HP-IB bus is accom¬
plished using mnemonics, such as CMD, which serve as the “bus
command.”
When bus commands are necessary, a typical addressing sequence is
<Unlisten Command> <Talk Address> <Listen Addresses>
This sequence is made up of three major parts which serve the following
purposes:
1. The unlisten command is the universal bus command with a char¬
acter code of “?”. It unaddresses all listeners. After the unlisten com¬
mand is transmitted, no active listeners remain on the bus.
2. The talk address designates the device that is to talk. A new talk
address automatically unaddresses the previous talker.
3. The listen addresses designate one or more devices that are to listen.
A listen address adds the designated device as listener along with
other addressed listeners.
This basic addressing sequence simply states who is to talk to whom.
The unlisten command (“?”) plays a vital role in this sequence. It is
important that a device receive only the data that is intended for it.
When a new talk address is transmitted in the addressing sequence, the
previous talker is unaddressed. Therefore, only the new talker can send
data on the bus and there is no need to routinely use an untalk
command in the same manner as the unlisten command.
Computers with High Level I/O Statements
In more powerful computers, higher level input/output (I/O) state¬
ments are used to specify device addresses on the HP-IB bus. In these
cases, the addressing protocol (unlisten, talk, listen) is a function of the
computer’s internal operating system and need not be of concern to the
user.
9-6 HP-IB INTERFACING
Sending and Receiving Data
Computer-to-Plotter
Transmitting data from a computer to the plotter is typically accom¬
plished using I/O statements such as WRITE, PRINT, PRINT#, or
OUTPUT. The following examples of sending program data to the
plotter from various computers are only intended to illustrate the nec¬
essity for understanding the I/O statement protocol implemented by
your computer. Each of these examples will cause the plotter to label the
identity of the computer sending data, beginning at the X,Y coordinates
1000,2000. The examples involve sending both character string and
numeric data as variables, and constants or literals.
HP 9825 and 9826 HPL Example:
0: fxd 0;dim R$ [13]
1: " SENDING DflTR" ->R$
2: 2000+Y
3: 9826-*B
4: wrt 705/'SRI ;PR1000," , Y
5: wtb 705,"LBHP", str(B),R*,3
6 : end
A terminator is sent by the 9825/9826 at the end of a wrt statement.
Result: HP 9826 SENDING DATA
9826 BASIC Example:
10 PRINTER IS 705
20 R$ =" SENDING DRTR"
30 B=9826
40 Y=2000
50 PRINT "SP1;PR1000, " ,Y
60 PRINT USING "K";"LBHP " ,B,R$,"V
70 END
A terminator is sent by the 9826 at the end of a PRINT statement.
Result: HP 9826 SENDING DATA
HP-IB INTERFACING 9-7
HP 9835/9845 Example:
10 PRINTER IS 7,5
20 R$ =" SENDING DRTR"
30 B=9835
40 C=9845
50 Y=2000
60 PRINT " SP1;PR1000,";Y
70 PRINT USING "K";"LBHP ",B,"/",C,R$,CHR$(3)
80 END
A terminator is sent by the computer at the end of a PRINT statement.
Result: HP 9835/9845 SENDING DATA
HP 2647 Example:
10 RSSIGN "H#5" TO #1
20 DIM R$ Cl 3]
30 R$="SENDING DRTR"
40 B=2647
50 Y*2000
60 PRINT #1;"SP1;PR1000,",Y
70 PRINT #1;"LBHP",B,R$,CHR$(3)
80 END
A terminator is sent by the 2647 at the end of PRINT #1 statements.
Result: HP 2647 SENDING DATA
HP-83/85 Example:
1 0 PRINTER lb 705
20 R$="SENDING DRTR"
30 B=85
40 Y=2000
50 PRINT " SP1 JPR1000,",Y
60 PRINT " LBHP" ;B;R$;"n "
70 END
A terminator is sent by the computer following PRINT statements.
Result: HP 85 SENDING DATA
9-8 HP-IB INTERFACING
TEK 4051 Example:
1 00 DIM fl$ Cl 3] , B$ Cl ]
110 R$=" SENDING DRTR
120 Y=2000
130 B=4051
135 B$ =CHR(3)
140 PRINT @5:"SP1;PRI000,";Y;"; "
150 PRINT @5:"LBTEK";B;R$;B$
160 END
No terminator is sent by the TEK 4051. It must, therefore, be included
in each PRINT @ 5 statement if the last HP-GL instruction in the line
requires one. In line 140, all characters after the Y may be omitted,
since the terminator is optional with the PA instruction.
Result: TEK 4051 SENDING DATA
Commodore PET* 2001 and CBM* 8032 Example:
10 OPEN 5,5
20 DIM R$ (1 3 )
30 R$=" SENDING DRTR"
40 B=2001
50 Y=2000
60 PRINT#5,"SP1;PR1000, " ;STR$(Y)
70 PRINT#5,"LBPET ";B;R$;CHR$(3)
80 END
A terminator is sent by the computer at the end of the PRINT #5
statement.
Result: PET 2001 SENDING DATA
Apple* II Applesoft BASIC Example:
10
PR# 3: IN#
3
20
Z$= "WT%" +
CHR$ (26)
30
DIM R$ (1 2 )
40
fl$= " SENDING DRTR"
50
Y= 2000
60
PRINT Z$; "
SP1;PRI000,"
, V
70
PRINT Z$; "
LBRPPLE II "
;R$;CHR$
80
PR# 0: IN#
0
80
END
* Commodore PET and CBM are trademarks of Commodore Business Machines,
Inc. Apple is a trademark of Apple Computer, Inc.
HP-IB INTERFACING 9-9
Result:
APPLE II SENDING DATA
The PR# 3: IN# 3 statement must be included in each program before
instructions can be sent to the plotter. These statements assume the
IEEE-488 interface card (HP-IB) is in slot three of the computer. The
string Z$ addresses the plotter at address 5 to listen. It must be
included in every print statement which sends HP-GL commands to the
plotter. The PR# 0: IN# 0 statement directs keyboard output to the dis¬
play and must be included before the end of the program or before any¬
thing can be printed on the display.
Plotter-to-Computer
Outputting data from the plotter to the computer is typically accom¬
plished using I/O statements such as READ, INPUT, or ENTER.
Sometimes these statements are only available in I/O ROMs; check
your computer’s documentation or ask your HP dealer or HP Sales and
Support Office. The following examples of obtaining output data from
the plotter using various computers are only intended to illustrate the
necessity for understanding the I/O statement protocol implemented
on your computer. Each of these examples commands the pen to move
to plotter coordinates X = 1000, Y = 1000 and then output the current
pen position and the plotter identifier string to the computer.
HP 9825 and 9826 HPL Example:
0: fxd 0;dim R$ [5]
1: wrt 705,"PR1000,1000;0C"
2: red 705,R,B,C
3: wr t 705,"01"
4: red 705,R$
5: dsp R,B,C,R$
6 : end
Displayed current pen position and identification.
1000 1000 0 7475A
HP 9826 BASIC Example:
10 PRINTER IS 705
20 PRINT "PR1000,lOOOjOC"
30 ENTER 705;R,B,C
40 PRINT "01"
50 ENTER 705;R$
60 DISP R,B,C,R$
70 END
Displayed current pen position and identification.
1000 1000 0 7475A
9-10 HP-IB INTERFACING
HP 9835/9845 Example:
10
PRINTER IS 7,5
20
PRINT
"PA1000,
1000;OC
30
ENTER
705;A,B,
C
40
PRINT
" 01"
50
ENTER
705;A$
60
DISP A
,B,C,A$
70
END
Displayed current pen position and identification.
1000 1000 0
HP 2647 Example:
10 nSSIGN "H#5" TO #1
20 PRINT #1;"Pfll 000,1000;0C"
30 READ #1 ; A,B,C
40 PRINT #1;"01"
50 READ #1 ; At
60 PRINT A,B,C,A$
70 END
Displayed current pen position and identification.
1000 1000 0 7475A
HP-85/86/87 Example :*
10 PRINTER IS 705
20 PRINT "PA1000,1000;0C"
30 ENTER 705 ; A,B,C
40 PRINT "01;"
50 ENTER 705' ; A$
60 DISP A,B,C,A$
70 END
Displayed current pen position and identification.
1000 1000
0 7475A
*Requires I/O ROM, HP Part No. 00087-15003.
7475A
HP-IB INTERFACING 9-11
TEK 4051 Example:
100 DIM fl$[5]
110 PRINT @5:"Pfll000,1000;OC;"
120 INPUT <§>5:R,B,C
130 PRINT @5:"01;"
140 INPUT @5:fl$
150 PRINT R,B,C,R$
160 END
Displayed current pen position and identification.
1000 1000 0 7475A
Commodore PET 2001 Example:
10 OPEN 5,5
20 PRINT#5,"PR1000,1000; OC"
30 INPUT#5,R,B,C
40 PRINTS,"01"
50 INPUT#5,R$
60 PRINT R,B,C,R$
70 END
Displayed current pen position and identification.
1000 1000 0 7475A
Commodore CBM 8032 Example:
On the CBM 8032, all alphabetic characters are displayed as lowercase.
This is true for both BASIC program statements and for the plotter’s
response.
A dummy string variable should be included at the end of every input
statement which reads data from the plotter because the CBM 8032
sends an untalk command after it receives a carriage return character.
Since the plotter with an HP-IB interface terminates all output with a
carriage return followed by a line feed, the line feed must be read into
this dummy string variable in order to clear the plotter’s output buffer
for future output.
10 OPEN 5,5
20 PRINT#5,"PR1000,1000;0C"
30 INPUT#5,R,B,C,B$
40 PRINT#5,"0I"
50 INPUT#5,R$,B$
60 PRINT R,B,C,R$
70 END
9-12 HP-IB INTERFACING
Displayed current pen position and identification.
1000 1000 0 7475a
Apple II Applesoft BASIC Example:
10 PR# 3; IN# 3
20 Z$= "NTH" + CHR$ (26)
30 Y$ = "RDE" + CHR$ (26)
40 PRINT Z$; "Pfll000,1000;0C;"
50 PRINT Y$;
60 INPUT R,B,C
70 PRINT Y$;
80 INPUT D$
90 PRINT Z$; "01"
100 PRINT Y$; 4 :
110 INPUT R$
120 PRINT Y$
130 INPUT D$
140 PR# 0: IN# 0
150 PRINT R,B,C,R$
160 END
Displayed current pen position and identification.
1000 1000 0
7475A
For an explanation of PR# 3, Z$ and PR# 0, refer to the Apple II
example in the prior section. The string Y$ instructs the plotter at
address 5 to talk. The Apple II sends an untalk command after it re¬
ceives a carriage return character. The plotter with an HP-IB interface
terminates all output with a carriage return followed by a line feed.
Therefore, in order to clear the plotter’s buffer for future output, another
talk instruction and another input statement containing a dummy
variable (D$ in this program) must follow the input statement which
reads parameters of the plotter output statement. The additional talk
and input instructions will read the line feed character, thus clearing
the plotter’s buffer.
HP-IB INTERFACING 9-13
Chapter
RS-232-C/CCITT V24
Interfacing
What You’ll Learn in This Chapter
This chapter is only for 7475 owners with an RS-232-C interface. HP
7475s with Option 001 have an RS-232-C interface.
This chapter describes how to connect the plotter, terminal, and com¬
puter in a modem or hardwire environment. It also discusses connect¬
ing the interface, pin allocations in the connector, baud rates, stop bits,
and transmission errors. It explains four possible operating modes:
normal and block modes, and switched lines and leased lines monitor¬
ing modes. A tutorial description of the four handshaking methods,
hardwire handshake, Xon-Xoff handshake, enquire/ acknowledge hand¬
shake, and software checking handshake, is included. The last part of
the chapter is devoted to the 14 device control instructions. The syntax
of device control instructions is given, followed by a detailed section on
each instruction. It is important to be able to use these instructions
properly to establish communications with the plotter in your operating
environment. You need to master the material in this chapter so you
can successfully send HP-GL instructions to the plotter.
NOTE: All information in this chapter applies equally to RS-232-C and
CCITT V.24 interfaces. For purposes of simplicity, both are referred to
as RS-232-C. ■
RS-232-C/CCITT V.24 INTERFACING 10-1
Setting Up Your RS-232-C Plotter:
a Checklist
The following steps should be followed when interfacing the 7475
plotter with a computer using an RS-232-C interface.
1. Determine which installation and operating environment, described
in the first few pages of this chapter, matches your system.
2. Check that you have the required cables and connect the plotter as
pictured in the section which describes the environment chosen in
step 1. Information necessary when constructing your own cable is
found in the section Connecting the RS-232-C Interface.
3. Determine if parity checking is used on your system and set the rear
panel parity switches Si and S2 accordingly. Refer to the 7475 Opera¬
tion and Interconnection Manual.
4. Determine the baud rate at which your computer sends data and set
the rear panel switches B1 through B4 accordingly. Refer to the 7475
Operation and Interconnection Manual.
5. Determine which handshake your system uses. The four kinds of
handshakes are described in the section entitled Handshaking. Note
which device control instructions are used to establish that hand¬
shake. Since handshaking is often a function of your operating
system, you may need to refer to the manuals for your computer to
determine which parameters you must set and to what values.
6. In the last part of this chapter, read about the instructions you will
use to set up the handshake you have chosen.
Plotter Environments
There are three possible ways to position the 7475 plotter in a computer
system. They are described in the following pages; you need only read
the section which applies to your system.
Once the plotter has been connected in a system, it can be placed in an
operating state. The operating states which can be accessed in a given
environment are described in the operation section for each of the three
environments.
Using a Plotter Directly Connected to a Computer
Mainframe or Personal Computer
Installation
In this type of system, the plotter is connected directly to a computer
and is usually adjacent to it. Entry to the computer is by a keyboard or
10-2 RS-232-C/CCITT V.24 INTERFACING
terminal through a separate port, rather than through the plotter. This
is sometimes referred to as an endline or stand-alone environment.
Diagrams of this type of system for both large and personal computers
are shown below, along with a picture of the rear panel connection.
COMPUTER SYSTEM DIAGRAM
COMPUTER MAINFRAME
PLOTTER
r
5 —^
_ i
—
i
11 1
PERSONAL COMPUTER
"| PLOTTER
/—
f
-1
i
REAR PANEL CONNECTIONS
POWER CORD
Plotter Connection with a Computer Mainframe or Personal Computer
Operation
Operation with this type of installation is usually confined to the on¬
line, programmed-on state. The rear panel switch labeled y/d should be
set to d (direct). When the switch is set to D, whenever power is being
applied to the plotter, it is in the on-line, programmed-on state. In this
state, the plotter reacts to all device control and HP-GL instructions
except the plotter off instruction. It is not possible to programmatically
turn the plotter off. Only when the switch is set to Y may the plotter be
RS-232-C/CCITT V.24 INTERFACING 10-3
placed in the on-line, programmed-off mode. That operating state is
described under operation with a terminal.
Using a Plotter in an Environment with a Terminal
Installation
In the second type of system, the plotter is connected in series between
the computer and the terminal. The plotter’s line switch must be ON in
order to have any communication between the terminal and the com¬
puter. There may be a direct wire between the computer and the plotter
or the plotter may be connected to a modem and communication may
take place over telephone lines. This setup, with the plotter between the
computer and the terminal, is sometimes referred to as eavesdrop
environment. A special Y-cable (Part No. 17455A), which joins the lines
from the computer and terminal into the plotter’s one connector, must
be used in this environment. Diagrams of the two systems, with and
without a modem, follow, along with pictures of the rear-panel connec¬
tions for both kinds of systems.
SYSTEM DIAGRAM
REAR PANEL CONNECTIONS
RS-232-C CABLE-►
17455A
CABLE PURCHASED FROM
HEWLETT-PACKARD
POWER
CORD
Plotter Interconnection with a Terminal and Remote Facility Using Modems
10-4 RS-232-C/CCITT V.24 INTERFACING
SYSTEM DIAGRAM
REAR PANEL CONNECTIONS
17455A
CABLE
PURCHASED FROM
HEWLETT-PACKARD
PLUG IN RS-232-C '
CONNECTOR FROM ^
TERMINAL HERE
PLUG IN RS-232-C
CONNECTOR FROM
COMPUTER HERE
POWER CORD-
Plotter Interconnection with a Terminal and Remote Facility
Using RS-232-C/CCITT V.24 Cabling
RS-232-C/CCITT V.24 INTERFACING 10-5
Operation
While operating in this environment, the plotter may be in one of three
states: on-line, programmed-off; on-line, programmed-on; or monitor
mode.
On-Line, Programmed-Off State
The plotter can only be in this state if the y/d switch on the rear panel
is set to Y (used with Y-cable). When this switch is set to Y, the plotter is
placed in the on-line, programmed-off state by either turning the
plotter’s line switch to ON or by receipt of a plotter off instruction from
the computer or of a terminal-generated Break signal while the plotter
is in the on-line, programmed-on state. In the on-line, programmed-off
state, the plotter’s processor passes data between the computer and the
terminal as shown in the following diagram. The plotter will respond
only to a plotter on instruction from the host computer.
COMPUTER Y-CABLE
“PLOTTER ON"
INSTRUCTION
PLOTTER
Plotter in On-Line, Programmed-Off State
10-6 RS-232-C/CCITT V.24 INTERFACING
On-Line, Programmed-On State
When the rear-panel switch labeled y/d is set to D, the plotter is placed
in the on-line, programmed-on state by turning on the plotter. When the
Y/D switch is set to Y, the plotter is switched from the on-line,
programmed-off state to the on-line, programmed-on state when a
plotter on instruction, ESC . ( or ESC . Y, is received from the computer.
When in this state, the plotter operates in response to instructions
received from the computer as shown in the following figure. When the
plotter instructions request output, it is provided as shown. The commu¬
nication channel from the terminal to the computer, through the
plotter, is maintained to provide operator entry into the computer.
The plotter’s processor monitors the channel from the terminal to the
computer for a terminal-generated Break signal. The plotter will inter¬
pret anything greater than a 130-millisecond space as a Break. This
Break signal is retransmitted to the computer and in-process plotter
outputs are aborted, but plotting continues until stored buffer data is
completed. A new plotter on instruction from the computer is required
to resume plotting operations. The plotter will ignore a Break signal if
the y/d switch is set to D.
It should be noted that in the on-line, programmed-on state (but not in
monitor mode which is described in the next paragraph) all data
generated by the terminal are routed through to the computer on a
noninterference basis when the plotter is not doing outputs. Data
generated by the terminal are ignored while output is occurring. How¬
ever, all data generated by the computer are intercepted by the plotter
and not passed to the terminal.
COMPUTER
I
OUTPUTS
i f
PLOTTER
INSTRUCTIONS
Plotter in On-Line, Programmed-On State
I
I
PROCESSOR
SCANS FOR
"BREAK"
RS-232-C/CCITT V.24 INTERFACING 10-7
Monitor Mode
After the plotter is in the on-line, programmed-on state, two mutually
exclusive monitor modes may be enabled using the set plotter configura¬
tion instruction, ESC . Depending upon which monitor mode is
enabled, either all data (including device control instructions) are re¬
transmitted to the terminal CRT or only HP-GL data are retransmitted
as they are parsed from the plotter’s buffer. All plotter output responses
are sent to both the computer and terminal. Refer to The Set Plotter
Configuration Instruction, ESC . @, for complete information.
The plotter monitors for a terminal-generated Break signal. Receipt of a
Break signal will cause the same results as described under the on-line,
programmed-on state. Then, new plotter on and set plotter configuration
instructions from the computer are required to resume plotting opera¬
tions with monitor mode active. The following diagram shows how the
plotter processes data while in monitor mode.
COMPUTER
i =
TERMINAL
PLOTTER
i
*
PROCESSOR
SCANS FOR
"BREAK'
, OUTPUTS
PLOTTER
INSTRUCTIONS
Monitor Mode
10-8 RS-232-C/CCITT V.24 INTERFACING
Using the Plotter in a Terminal-only Environment
Installation
The 7475 plotter can be directly connected to a terminal if a specially
constructed, user-supplied cable is used that cross connects lines 2 and
3. While there is no computer in this configuration, the terminal usually
has some “intelligence.” When the terminal and plotter are connected
using this special cable, the terminal may be used to send instructions
to the plotter. A diagram of the terminal-only environment and a
picture showing the rear-panel connection follow.
SYSTEM DIAGRAM
TERMINAL
PLOTTER
REAR PANEL CONNECTIONS
SPECIALLY CONSTRUCTED
RS-232-C CABLE —^
SUPPLIED BY USER
o
POWER CORD
Plotter Interconnection with Only a Terminal
RS-232-C/CCITT V.24 INTERFACING 10-9
Operation
The rear-panel switch labeled y/d should be set to d. If it is set to Y, the
plotter must receive a plotter on instruction, ESC. ( or ESC . Y, before
it will respond to other instructions from the terminal. The terminal
should be set to half duplex in order to view the characters being sent
to the plotter. Plotter output will be displayed on the terminal. The
following diagram shows plotter operation when in the programmed-on
state in a terminal-only environment.
TERMINAL IN
HALF DUPLEX
r~
r
2 ^
PLOTTER
2
3
I i
k
OUTPUT
1
f
PLOTTER
INSTRUCTIONS
Terminal-only Environment, Programmed On
Connecting the RS-232-C Interface
The 7475 plotter interfaces to the RS-232-C communications lines
through a standard 25-pin female connector mounted on the back of the
plotter. The 7475 is capable of operating in a three-wire (transmit,
receive, ground) configuration.
In hardwired handshake operation, the Data Terminal Ready line (pin
20 of the connector on the plotter) is used to monitor the space in the ——
buffer available for input. The plotter outputs data when requested
(refer to Hardwire Handshake in this chapter).
If you are fabricating the cable assembly, the connector should be a ""
25-pin type “D” subminiature CINCH DBC-25P plug or equivalent.
Connector pin allocations for the three-wire configuration are identified __
and described in the following table.
10-10 RS-232-C/CCITT V.24 INTERFACING
Minimum Interface Connector Pin Allocations
Pin No.
RS-232-C
CCITT V.24
Function/Signal Level
2
BA
103
Transmitted Data
High = SPACE = “0”
= +12 V
Low = MARK = ‘T”
= -12 V
3
BB
104
Received Data
High = SPACE = “0”
= +3 V to +25 V
Low = MARK = “1”
= -3 V to -25 V
7
AB
102
Signal ground (Common
return)
In addition to the minimum requirements for communication, ten more
lines are connected as shown in the following table. These lines are
required to implement full duplex communication, intermediate baud
rate, hardwired handshake mode, and monitor mode. All remaining
pins make no internal connection.
Pins 14 and 16 are wired in the special Y-cable, available as Option 16,
to implement monitor mode. The Y-cable schematic is shown below.
Hardwire handshake cannot be used to prevent buffer overflow
when the Y-cable is connected. This is because pin 20 is connected
between the computer and terminal connectors, but not to the plotter
connector. ■
PINS 4,5, 6, AND 8 THROUGH 25 ARE DIRECTLY CONNECTED BETWEEN THE
COMPUTER AND TERMINAL CONNECTORS.
Y-cable Schematic
RS-232-C/CCITT V.24 INTERFACING 10-11
Additional Connector Pin Allocations
Pin No.
RS-232-C
CCITT V.24
Function/Signal Level
1
AA
101
Protective ground
4
CA
105
Request To Send from the
plotter
Always High = ON
= +12 V
5
CB
106
Clear to Send
High = ON = +3 V to
+25 V
Low = OFF = —3 V to
-25 V
6
CC
107
Data Set Ready
High = ON = +3 V to
+25 V
Low = OFF = -3 V to
-25 V
8
CF
109
Received Line Signal
Detector
High = ON = +3 V to
+25 V
Low = OFF = -3 V to
-25 V
17
DD
115
External Clock Input
High = ON = +3 V to
+25 V
Low = OFF = —3 V to
-25 V
20
CD
108.2
Data Terminal Ready to
modem
High = ON = +12 V
Low = OFF = -12 V
23
CH/CI
Data Signal Rate Selector
Always High = ON
= +12 V
14*
SBA
118
Secondary Transmit Data
Data line from plotter to
terminal
16*
SBB
119
Secondary Received Data
Data line to plotter from
terminal
*Used to establish monitor mode with special Y-cable (Part No. 17455A).
10-12 RS-232-C/CCITT V.24 INTERFACING
For FTZ/European applications, two additional modes are available:
switched lines monitoring mode and the leased lines monitoring mode.
In the switched lines monitoring mode, the CC and CB will be moni¬
tored. If either of these lines go low, the CD line will be driven low by
the plotter to automatically disconnect the channel from the line. This
mode is enabled by depressing the pen 5 pushbutton on the front panel
during power-up.
In the leased lines monitoring mode, the CC, CB, and CF will be
monitored. If any of these lines go low, the CD line will be driven low
by the plotter to automatically disconnect the channel from the line.
This mode is enabled by depressing the pen 6 pushbutton on the front
panel during power-up.
If none of the pen pushbuttons are depressed at power-up, the plotter is
in normal mode (3-wire mode).
NOTE: If you are using an eavesdrop cable and you set up a switched
line monitoring mode or a leased lines monitoring mode, the plotter will
not be able to monitor the other signal lines such as CB, CC, CF, and
DTR, and you will not be able to output data. Also, if either switched
lines monitoring mode or leased lines monitoring are operational, you
cannot use hardwire handshake. ■
Output Baud Rate
The plotter is designed to operate in an asynchronous mode with
switch-selectable baud rates of 75, 110, 150, 200, 300, 600, 1200, 2400,
4800, and 9600. However, setting all baud switches to zero and connect¬
ing an external clock input to pin 17 of the connector allows operation
of the plotter at any intermediate baud rate up to 9600 baud. Both the
receiver (RRC) and transmitter (TRC) clocks will operate at the same
clock rate. Requirements for the clock signal are as follows:
1. The clock frequency must be 16 times the desired baud rate.
2. The baud rate must not exceed 9600.
3. The duty cycle of the clock pulse should be close to 50%.
4. The clock pulse must be a logic on of +2 V < V < 25 V and a logic
off of-25 V < V < +0.8 V (3.5 kfl input impedance).
5. Care should be taken to keep the transmission lines as short as
possible to minimize transmission line reflection noise.
RS-232-C/CCITT V.24 INTERFACING 10-13
Stop Bits
The plotter is configured to automatically verify or generate one or two
stop bits, depending on the setting of the plotter’s baud rate switches.
Refer to the 7475A Operation and Interconnection Manual for more
information.
Transmission Errors
Transmission errors occur when communication between the computer
and plotter is incomplete or does not conform to what is expected or
required by either party.
Transmission errors include:
• Framing error — the plotter does not detect a valid stop bit at the end
of every character.
• Parity error — the plotter does not detect the expected parity (odd or
even).
• Overrun error — a plotter instruction writes over another instruction.
• Buffer overflow error — the plotter receives more bytes of data than it
has space for in the buffer.
When the plotter detects a framing, parity, or overrun error, it turns on
the front panel error light and sets error code 15. This error code
generally indicates that the communication incompatibility is hardware
related (incorrect stop bit jumper installation, wrong parity selection,
incompatible or incorrectly set baud rates, etc.).
When the plotter detects a buffer overflow, it turns on the front panel
error light and sets error code 16. The last HP-GL data that caused the
overflow will be lost. Error code 16 generally indicates an improperly
established handshake protocol.
The ERROR light remains on until either the user interrogates the plotter
via an output extended error instruction, ESC . E, and the plotter re¬
sponds with the appropriate error code, or the user turns the plotter off,
or an HP-GL initialization instruction, IN, is processed, or a front-panel
reset occurs.
A complete list of error codes is included with the discussion of the
ESC . E instruction.
NOTE: A buffer overflow condition may also cause an HP-GL error to
occur. In this case, an HP-GL IN or OE instruction or a front-panel
reset must be executed in order to clear the error light. See Chapter 7
for an explanation of the output error instruction, OE. ■
10-14 RS-232-C/CCITT V.24 INTERFACING
H andshaking
The 7475 uses a 1024-byte input buffer to synchronize the processing of
data with the rate at which it is received. The presence of an input
buffer requires that the computer and the plotter transfer information
to one another in such a way that data will not be lost or misinterpreted.
This is the purpose of handshaking.
The 7475 is capable of using any one of four handshaking methods to
prevent buffer overflow and the resulting loss of data. The computer
system’s capabilities and requirements dictate which handshake method
is appropriate.
• Hardwire Handshake — uses a physical wire, pin 20 of the RS-232-C
cable, to control handshaking. It can be used if the computer system
can or does monitor pin 20 (DTR).
• Xon-Xoff Handshake — is managed by the peripheral device. It can
be used if the computer system follows an Xon-Xoff protocol (control
characters are transmitted from the peripheral to the computer).
• Enquire/Acknowledge Handshake — is managed by the computer
system and interface. This handshake is often used in Hewlett-
Packard systems and is so named because the ASCII characters
ENQ and ACK may be used to control the handshake.
• Software Checking Handshake — is managed by the applications
programmer. It can be used on almost any computer system, but it
must be used if the system cannot implement any of the other three
handshaking methods.
Once the handshake method is selected, the 7475 can be program¬
matically instructed to match the computer system requirements, imple¬
ment the chosen handshake method, and function properly within the
system-dependent communication environment. This is done by specify¬
ing certain variables in device control instructions which are issued to
the 7475 at the beginning of each computer session or graphics program.
The variables, which may be specified by using the decimal value of
the character desired to establish one of the four handshake methods
available to the 7475, are:
• Output Trigger Character — The output trigger character, when
used, is the last character output by the computer when making a
request of a graphics peripheral. Defining this character in an instruc¬
tion tells the plotter, “Don’t respond to my request until you receive
this trigger character.” This character is often a DCl (decimal equiva¬
lent 17) or some other nonprinting ASCII character such as LF or CR
or, when using some implementations of BASIC, the ? (decimal
equivalent 63), which does print.
RS-232-C/CCITT V.24 INTERFACING 10-15
• Turnaround Delay — The turnaround delay is the length of time the
plotter will wait after receiving a computer request and the trigger
character, if any, before it responds. The purpose of this time delay is
to delay the plotter’s transmission of requested data until the com¬
puter is ready to receive and process it. Systems may require either a
turnaround delay or a trigger character, or both.
• Output Initiator Character — The output initiator character is a one-
character initiator that is sent by the plotter at the beginning of a
string. The output initiator tells the computer, “This starts my trans¬
mission.” Some computers which require an output initator expect
the start-of-text character, STX (decimal equivalent 2), as the plotter’s
output initiator.
• Output Terminator — The output terminator is a one- or two-character
terminator that the computer requires the plotter to send at the end of
each response to a data request. The output terminator tells the
computer, “This completes my transmission.” Often, computers expect
the carriage return character, CR (decimal equivalent 13), as the
plotter’s output terminator.
• Echo Terminate Character — Echoing is commonly found in full
duplex systems. Use of the echo terminate parameter in a device
control instruction tells the plotter that the computer will echo all
responses and that this echoed data should be ignored (the plotter’s
data buffer should be closed) until an echo terminate character is
received. When the plotter receives the echo terminate character, it
reopens the data buffer to receive graphics data from the computer.
Computers often use the line feed character, LF (decimal equiva¬
lent 10), as the echo terminator. If the computer does not echo the
peripheral’s response, this variable must be zero (equivalent to null)
or must be omitted.
• Intercharacter Delay — Some computers cannot process data as fast
as the plotter can transmit it due to limited buffering in the I/O port.
This can be compensated for by delaying each transmission from the
plotter a period of time as specified by the intercharacter delay
variable. This intercharacter delay is added to a turnaround delay (if
one has been specified) before the first character is sent by the
plotter, and is also inserted before each subsequent character in a
string being sent to the computer.
• Enquiry Character — In some systems the computer sends an enquiry
character to ask the plotter if it has room for a block of data, thereby
initiating the handshake process. If Xon-Xoff handshake mode is to
10-16 RS-232-C/CCITT V.24 INTERFACING
be established, a NULL character (decimal equivalent 0) must be
specified as the enquiry character. If enquire/acknowledge is to be
established, an ENQ character (decimal equivalent 5) or any other
ASCII character besides the NULL is used.
Immediate Response String — Certain system environments require
an immediate response from the plotter acknowledging the enquiry
from the computer. Systems of this type include a computer that
transmits data to the plotter after a certain time interval but before
receiving a go-ahead signal from the plotter. If the plotter’s buffer is
full and the computer sends more data, the buffer will overflow. The
immediate response string prevents this inadvertent transmission of
data before the plotter is ready. It is transmitted by the plotter
immediately after receipt of an enquiry character and tells the com¬
puter, “Wait, I am here and checking my buffer space.” Computers
frequently require a DC3 character (decimal equivalent 19) for the
immediate response.
Acknowledgment String — The acknowledgment string specifies the
character or characters that the plotter will send to the computer
when the plotter’s input buffer has room for another block of data.
Computers frequently require that the ACK character (decimal equiva¬
lent 6) be used for the acknowledgment string.
Data Block Size — This is the maximum size of each data block the
computer will transmit to the plotter.
Data Terminal Ready (CD) Line Control — This variable sets the
configuration of the plotter’s Data Terminal Ready control line (pin 20)
to enable or disable the hardwire handshake mode. Pin 20 is held on
(+12 V) if hardwire handshake is disabled.
Xoff Threshold Level — In the Xon-Xoff handshake mode this defines
how many empty bytes remain in the buffer when the plotter sends
the Xoff trigger character to the computer, telling it to stop sending
data.
Xoff Trigger Character — This specifies the character string the
plotter will use to signal the computer to temporarily stop sending
data while the plotter processes what it has already received. The
DC3 character (decimal equivalent 19) is generally used for the Xoff
trigger.
Xon Trigger Character — This specifies the character string the
plotter will use to signal the computer that there is sufficient space in
the buffer to resume sending data. The DCl character (decimal
equivalent 17) is generally used for the Xon trigger.
RS-232-C/CCITT V.24 INTERFACING 10-17
The following discussion of the four handshake methods includes the
pertinent variables and identifies the instructions which will establish
their values.
Software Checking
Software checking is a nonautomatic handshake method in which the
user’s program repeatedly asks the plotter how many characters of
empty space remain in the buffer. When the plotter response is bigger
than the next block of data, the program will transmit the data block to
the plotter. This method is inefficient in time-share environments.
The advantage of software checking is that it is independent of hard¬
ware and operating system abilities required to implement other hand¬
shake modes; therefore, it usually makes software transportable between
computer systems. The limitation of this method of handshaking is
that it uses up computer time.
To match the requirements of the computer system, these variables
may be specified for the software checking handshake mode by using
the appropriate instruction:
• Turnaround delay (ESC . M instruction)
• Output trigger character (ESC . M instruction)
• Echo terminate character (ESC . M instruction)
• Output initiator character (ESC . M instruction)
• Output terminator (ESC . M instruction)
• Intercharacter delay (ESC . N instruction)
10-18 RS-232-C/CCITT V.24 INTERFACING
The following flow diagram illustrates the functional elements of a
typical software checking handshake within a user’s program.
START
RS-232-C/CCITT V.24 INTERFACING 10-19
Xon-Xoff Handshake
With the Xon-Xoff handshake method, the plotter controls the data
exchange sequence by telling the computer when it has room in its
buffer for data and when to shut off the flow. The plotter uses buffer
threshold indicators (an Xon trigger character and an Xoff trigger
character) to prevent buffer overflow.
OVERSHOOT (DUE TO TIME REQUIRED TO
REACT TO XOFF TRIGGER CHARACTER)
Xon-Xoff Threshold Levels
TOTAL
BUFFER
SPACE
AVAILABLE
1024
As data is sent to the plotter by the computer, it is stored in the buffer
and simultaneously acted on by the plotter. The preceding figure is
representative of the way the Xon-Xoff handshake works; the numbers
represent the following:
1. Data enters the buffer faster than it can be acted on by the plotter,
and the buffer starts to fill.
2. The plotter begins processing the input data faster than the computer
sends it, and the buffer starts to empty.
3. The data enters the buffer at a faster rate than the plotter can
process it. The amount of data stored in the buffer reaches the Xoff
threshold level, at which point the plotter sends the Xoff trigger
character stopping the flow of data from the computer.
4. Due to a finite delay between the time the plotter sends the Xoff
trigger character and the time it takes the computer to react, a slight
overshoot may occur. For this reason, the Xoff threshold level should
always be specified at least as large as the data block size or the
10-20 RS-232-C/CCITT V.24 INTERFACING
maximum number of bytes sent by an output statement to allow
room for the overshoot.
5. Once the Xoff trigger character has been sent, when the amount of
stored data drops to the Xon threshold level, the plotter sends the
Xon trigger character to signal the computer to resume sending
data. The Xon threshold level is automatically set at 512 bytes. If the
Xoff threshold level is greater than 512, the Xon threshold is reset to
send the Xon character when one more byte than required by the
Xoff threshold is available in the plotter’s buffer.
6. Data is again stored in the buffer until all the data are transferred or
until the Xoff threshold level is exceeded again.
The following conditions can be specified for the Xon-Xoff handshake
mode to match the requirements of the computer system, by using the
appropriate instruction:
• Xoff threshold level (ESC . I instruction)
• Xon trigger character (ESC . I instruction)
• Xoff trigger character (ESC . N instruction)
• Intercharacter delay (ESC . N instruction)
The enquiry character (ESC. I instruction) must either be defaulted or
specified as zero.
Enquire/Acknowledge Handshake
With the enquire/acknowledge handshake, the computer’s operating
system or application program initiates the data exchange process by
querying the plotter about the availability of buffer space. The format
of the exchange is dependent upon the requirements of the computer.
The following conditions can be specified for the enquire/acknowledge
handshake mode by using the appropriate instruction:
• Turnaround delay (ESC . M instruction)
• Output trigger character (ESC . M instruction)
• Echo terminate character (ESC . M instruction)
• Output initiator character (ESC . M instruction)
• Output terminator (ESC . M instruction)
• Intercharacter delay (ESC . N instruction)
• Immediate response string (ESC . N instruction)
• Data block size (ESC . I or ESC . H instruction)
RS-232-C/CCITT V.24 INTERFACING 10-21
• Enquiry character (ESC . I or ESC . H instruction)
• Acknowledgment string (ESC . I or ESC . H instruction)
In its simplest form, the data exchange looks like this:
ENQ/ACK Handshake Protocol Example 1
In a more complex form, the communication might look like the
following example, where the two instructions EH . M250; 17; 10; 13:
and . H100; 5; 6: have been sent to specify the variables as:
turnaround delay = 250 ms
output trigger character = ASCII character DCl (decimal equiva¬
lent 17)
echo terminate character = ASCII character LF (decimal equiva¬
lent 10)
output terminator = ASCII character CR (decimal equivalent 13)
data block size = 100 bytes
enquiry character = ASCII character ENQ (decimal equivalent 5)
acknowledgment string = ASCII character ACK (decimal equiva¬
lent 6)
10-22 RS-232-C/CCITT V.24 INTERFACING
DO YOU HAVE BUFFER SPACE FOR A 100-BYTE BLOCK OF DATA
"ENQ" (ENQUIRY CHARACTER)
THIS ENDS REQUEST, PLEASE ACKNOWLEDGE
HOST
COMPUTER
"DCT' (OUTPUT TRIGGER CHARACTER)
PLOTTER
YES, THERE IS ROOM FOR 100 BYTES
r "
1
ECHO |
250 MS DELAYED "ACK'' (ACKNOWLEDGEMENT STRING)
THIS IS END OF MY MESSAGE
1
r~\
i i
"CR" (OUTPUT TERMINATOR)
ECHO J “
1
1
1_
"ACK”
"CR"
"LF" (ECHO TERMINATE CHARACTER)
100-BYTE DATA BLOCK
ENQ/ACK Handshake Protocol Example 2
Hardwire Handshake
As the name implies, the hardwire handshake takes place in the
hardware rather than the firmware or software. The plotter controls the
data exchange sequence by setting the electrical voltage on pin 20 of
the connector (CD line) to the computer to signal the computer when to
send another block of data. If there is enough room in the plotter’s
buffer to accept and store another block of data, the plotter sets the
Data Terminal Ready, CD, line to a high state. If there is insufficient
space, it sets the line low. By monitoring this line, the computer knows
when it can or cannot safely transmit another block of data.
The hardwire handshake mode is enabled at power on or by setting the
Data Terminal Ready, CD, line control using the ESC . @ instruction.
Data Transmission Modes
The RS-232-C version of the 7475 has two modes of data transmission:
normal mode and block mode.
Normal Mode
In normal mode, all HP-GL instructions are put in an execution buffer
where they are parsed and executed in order. Escape sequence instruc¬
tions (ESC . E, ESC . B, ESC . M, etc.) are not buffered but are executed
immediately.
Block Mode
In block mode, all characters received are put in an intermediate buffer
except for escape sequence instructions and handshake characters.
Escape sequence instructions are still executed immediately.
DATA
BUFFER
CLOSED
RS-232-C/CCITT V.24 INTERFACING 10-23
The size of a block is variable and is not defined explicitly. A new block
is started after an ESC . E instruction has been received. A block of
instructions is terminated by the receipt of another ESC . E instruction
which outputs the current RS-232-C error state. Refer to the ESC . E
instruction for additional information.
Block mode has no effect on the type of handshaking used or on the
handshaking parameters that are defined. The number of characters in
the intermediate buffer plus the number of characters in the execution
buffer cannot exceed a total of 1024 characters.
Access block mode by setting bit 4 in the second parameter of the
ESC . @ instruction. Set this bit to 0 for normal mode and to 1 for block
mode. Refer to the discussion of the ESC . @ instruction for additional
information. Use block mode to catch transmission errors that have
reached the plotter. This allows you to retransmit the correct block of
data, and thus prevent errors to the plot.
When the 7475 powers up, it is in normal mode. When block mode is
turned on, any characters in the buffer are put in the execution buffer.
When block mode is turned off, the state of the intermediate buffer is
undefined. Before turning off block mode, send an ESC . E instruction
to clear out the intermediate buffer.
NOTE: It is not advisable to use the ESC . L instruction when in block
mode as it may disrupt communication. If you use an ESC . L instruc¬
tion while in block mode, use it immediatley after an ESC . E instruc¬
tion. Send the ESC . E instruction, read the response, send the ESC . L
instruction, read the response, and then send the additional HP-GL
instructions. ■
RS-232-C Device Control Instructions
Device control instructions establish the handshake protocol to be used
by the 7475 plotter. All communications conform to the protocol estab¬
lished by these instructions. The instructions serve two purposes: to
control the method by which data is transferred between the computer
and the plotter (input/output operations), and to give the computer the
ability to query and to receive information from the plotter.
Each instruction’s name gives an immediate clue to its purpose: if
“output” is the first word in the name of the instruction, the computer
wants a response from the plotter. Otherwise, the instruction concerns
the I/O functions. The word “set” in the title indicates the instruction
conditions under which subsequent I/O is to occur.
10-24 RS-232-C/CCITT V.24 INTERFACING
The plotter acts on device control instructions immediately upon receipt.
It does not store them in the data buffer.
Syntax for Device Control Instructions
Device control instructions are three-character escape code sequences
comprised of “ESC” and followed by one of the characters B, E,
H, I, J, K, L, M, N, or O, R,), (, Y, or Z.
These syntax conventions are used with the instructions discussed in
this chapter:
[ ]
( )
<DEC>
<ASC>
TERM
Brackets indicate that all parameters enclosed
are optional.
Parentheses indicate that each individual pa¬
rameter is optional.
The semicolon follows and delimits parameters.
If a semicolon appears without a parameter, the
parameter is defaulted.
The colon terminates any instruction which may
have parameters and can occur after any valid
number of parameter entries. Any parameter
that is not specified is defaulted.
This symbol specifies a decimal value parameter.
For example, the characters 10 would represent
the decimal value ten; the characters 13 would
represent the decimal value thirteen.
This symbol specifies the decimal equivalent for
an ASCII character (see the ASCII Character
Equivalents table in Appendix C). In this case,
the characters 10 would represent the ASCII
line feed character, LF, and 13 would represent
the ASCII carriage return character, CR.
Specifies a number of optional parameters. Each
parameter must be followed by a delimiter (;) or
the terminator (:).
Unless changed by an ESC . M instruction, all
RS-232-C output responses include a CR as a
terminator.
RS-232-C/CCITTV.24 INTERFACING 10-25
Default Values; Any parameter may be omitted or, if the parame- - -
Omitting Parameters ter is required, it can be set to its default value
by omitting the parameter and entering only
the semicolon as a delimiter. All parameters - -
may be omitted and therefore set to default
values by entering only the colon terminator
after the instruction. - -
L£Id Denotes the single ASCII character, Escape,
which in most computers is accessed by striking
a single key on the keyboard.
NOTE: There is no delimiter (semicolon) be¬
tween the three-character command sequence,
e.g.,G23 . O, and the first parameter. ■
The Plotter On Instruction, ESC . (
or ESC . Y
EHH The plotter on instruction, ESC . ( or ESC . Y, places a
plotter which is powered on into the on-line, programmed-on mode so
that it will accept incoming data and interpret it as plotter instructions.
llclTl This instruction is used when the rear-panel switch labeled y/d
is set to Y to ready the plotter to accept other instructions. It is sent at
the beginning of any plotting program or when the user wishes to
resume plotting after the plotter has been turned off by an ESC . ) or
ESC . Z instruction or a Break.
SYNTAX
.(
or
[S3 • Y
EXPLANATION
This instruction is ignored when the rear-panel switch
labeled y/d is set to D since, in that case, turning on the power places
the plotter in the programmed-on state.
Beginning with the next character, the plotter will accept incoming
data and interpret it as plotter instructions. If the plotter is already in
the programmed-on state, it will ignore this instruction.
The Plotter Off Instruction, ESC .)
or ESC . Z
DESCRIPTION
The plotter off instruction, ESC . ) or ESC . Z, takes the
plotter out of on-line, programmed-on state so that it neither accepts
nor interprets incoming data until another plotter on instruction is
received.
10-26 RS-232-C/CCITT V.24 INTERFACING
ircrei The instruction is used to deactivate the plotter. It is used at
the end of a graphics program or in some environments to allow data to
be passed through the plotter to the terminal.
SYNTAX
[S3.)
or
rea . z
EXPLANATION
This instruction is ignored when the rear-panel switch
labeled y/d is set to d. When that switch is set to D, it is not possible to
turn the plotter off programmatically.
Beginning with the next character, the plotter will assume a passive
state and remain in that state until a plotter on instruction is received.
Any HP-GL instructions remaining in the buffer at the time that a
plotter off instruction is received are executed. However, no additional
HP-GL instructions will be accepted by the plotter.
NOTE: A Break signal from the terminal will have the same effect as a
plotter off instruction. ■
The Set Plotter Configuration Instruction,
ESC . @
DESCRIPTION
The set plotter configuration instruction, ESC . @, speci¬
fies an effective maximum buffer size, and sets parameters necessary
for hardwire handshake mode, monitor mode, and Data Transmission
Mode.
llKiyi The instruction is used to set up an effective maximum buffer
size, to enable or disable hardwire handshake or monitor mode, and to
establish Data Transmission Mode.
SYNTAX
DEFAULT
. @ [ «DEC» ; (<DEC» ]:
13351 . @ : Sets up default buffer size (1024 characters),
enables hardwire handshake, disables monitor mode, and leaves the
Data Transmission Mode unchanged.
EXPLANATION
A description of the instruction’s parameters follows:
<DEC> The first parameter is not required; if a parameter is
included, it specifies an effective maximum buffer size.
Parameter range is 0 to 9999. A parameter equal to or
greater than 1024 is interpreted as 1024. The semicolon
must precede any second parameter.
<DEC> Only bits 0, 2, 3, and 4 are used. Bit 0 of the second
parameter establishes hardwire handshake with Data
Terminal Ready, CD, line control. Bit 2 establishes the
RS-232-C/CCITT V.24 INTERFACING 10-27
type of monitor mode. Bit 3 set to 0 disables monitor
mode; set to 1 enables the monitor mode established by
bit 2. Block mode is enabled by setting bit 4 in the
second parameter to 1. Setting bit 4 to 0 enables normal
mode. Refer to the discussion of block mode in this
chapter for additional information. If the second parame¬
ter is not specified, the Data Transmission Mode is
unchanged.
The following chart describes the second parameter bit
functions.
Bit
No.
Logic
State
Description
0
0
Set and hold line high (disable hard¬
wire handshake).
1
Enable hardwire handshake mode.*
1
X
Ignored.
2
0
Establish monitor mode 0 (all bytes
displayed on terminal as they are
parsed from the buffer).
1
Establish monitor mode 1 (all bytes
displayed as they are received).
3
0
Disable monitor mode.
1
Enable the monitor mode established
by bit 2.
4
0
Enable normal mode.
1
Enable block mode.
*When hardwire handshake is enabled, the DTR line becomes
a “buffer space available” flag. The line is high when available
buffer space is greater than or equal to the current block size,
and is held low when available buffer space is less than the
current block size. This size defaults to 80 bytes unless a dif¬
ferent value is specified by the ESC . H or ESC . I instruction.
EXAMPLE
I. @; 13: will establish monitor mode 1 where all bytes
are displayed on the terminal as they are received by the plotter.
The Output Buffer Space Instruction,
ESC . B
BMMMUlillUhl The output buffer space instruction, ESC . B, outputs
the plotter’s available buffer space.
10-28 RS-232-C/CCITT V.24 INTERFACING
This instruction is used in a software checking handshake to
interrogate the plotter regarding available buffer space.
E3 . B
SYNTAX
EXPLANATION
No parameters are used.
RESPONSE
<DEC> The plotter’s response is a decimal number in the range
0 to 1024, and represents the number of bytes of buffer
space currently available for storing graphic instructions
sent from the computer.
TERM This decimal number is followed by the output termina¬
tor which defaults to carriage return, CR, or is as set by
ESC . M.
The Output Extended Error Instruction,
ESC . E
DESCRIPTION
The output extended error instruction, ESC . E, outputs
a number which defines any RS-232-C related I/O error and turns off
the front-panel ERROR light, if no HP-GL instruction errors are present.
HK1¥l The instruction is used to define what type of RS-232-C related
I/O error has occurred, if any.
SYNTAX
E
I No parameters are used.
RESPONSE
<DEC> The plotter’s response is a decimal number, either 0 or
in the range 10-16, followed by the output terminator.
The meaning of the response is as defined in the follow¬
ing table.
RS-232-C/CCITT V.24 INTERFACING 10-29
Error
No.
Meaning
0
No I/O error has occurred
10
Output instruction received while another
output instruction is executing. The original
instruction will continue normally; the one
in error will be ignored.
11
Invalid byte received after first two charac¬
ters, EH ., in a device control instruction.
12
Invalid byte received while parsing a device
control instruction. The parameter containing
the invalid byte and all following parameters
are defaulted.
13
Parameter out of range.
14
Too many parameters received. Additional
parameters beyond the proper number are ig¬
nored; parsing of the instruction ends when a
colon (normal exit) or the first byte of another
instruction is received (abnormal exit).
15
A framing error, parity error, or overrun
error has been detected.
16
The input buffer has overflowed. As a result,
one or more bytes of data have been lost, and
therefore an HP-GL error will probably occur.
NOTE: The receipt of something other than another
parameter, a semicolon, or a colon will result in error 12
overwriting error 14. ■
TERM The terminator defaults to carriage return, CR, unless it
is set by an ESC . M.
To check for transmission errors in a data block, first enter block mode
by setting bit 4 of the second parameter of the ESC • @ instruction to
logic state 1 (decimal value 16). Then begin sending data blocks, follow¬
ing each with the ESC . E instructiion.
In block mode, there are two possible types of response to the ESC . E
instruction. If the response to the ESC . E instruction is zero, then there
have been no transmission errors since the last ESC . E. In this case,
the block of HP-GL instructions is transferred to the execution buffer
and the instructions are executed in order. If the error number in
response to the ESC . E instruction is 10-16, then there has been a
transmission error since the last ESC . E. In this case, the block of
10-30 RS-232-C/CCITT V.24 INTERFACING
HP-GL instructions is discarded. The controller must then retransmit
this block of instructions.
The following diagram illustrates block checking:
Block Checking
Computer Plotter Comments
ESC . E
Data block A
ESC . E
Data block A
ESC . E
Data block B
ESC . E
Data block B
ESC.E
Any I/O errors?
- 0<term> No errors
At this point, the plotter
transfers previously-
received block to the
execution buffer.
Send a block of data
Assume a byte gets
garbled (bad parity).
Any I/O errors?
15<term> Parity, framing, or over¬
run error
At this point, the plotter
discards the block.
Retransmit the block
Any I/O errors?
- 0<term> No errors
Plotter transfers block
to the execution buffer.
Send a block of data
Assume a handshake
byte gets lost, and
buffer overflows.
Any I/O errors?
16<term> Buffer overflow
Block is discarded.
Retransmit the block
Any I/O errors?
- 0<term> No errors
Block is transferred to
the execution buffer.
RS-232-C/CCITT V.24 INTERFACING 10-31
The Set Handshake Mode 1 Instruction,
ESC . H
DESCRIPTION
The set handshake mode 1 instruction, ESC. H, may
be used with the enquire/acknowledge or Xon-Xoff handshake to estab¬
lish parameters for the plotter’s communication format.
UKIM It establishes the data block size, the enquiry character, and
the acknowledgment string when the computer requires that the parame¬
ters set in the ESC. M instruction be used in response to the enquiry
character or Xon character.
SYNTAX
DEFAULT
E3 • H [ «DEC>); «ASC>); «ASC>(;. . . <ASC») ]:
I . H: See ESC . I default.
EXPLANATION
The two instructions, ESC. H and ESC. I, are mu¬
tually exclusive. The parameter descriptions are the same for both
instructions and are given under the ESC . I instruction.
Handshake mode 1, established by this instruction, uses defaulted or
specified parameters of the ESC. M and ESC . N instructions when
responding to the enquiry or Xon trigger character.
The parameters used with handshake mode 1, handshake mode 2, and
output responses are shown in the following table. Choose the mode
and use handshake mode 1 (ESC . H) or handshake mode 2 (ESC . I)
depending on the requirements of your system.
10-32 RS-232-C/CCITT V.24 INTERFACING
Parameter Usage in Plotter/Computer Communication
With Handshake Characters
With Plotter
Output
Instructions
Parameter
In Mode 1
In Mode 2
turnaround
delay
yes
yes
yes
output trigger
character
yes
no
yes
echo
terminator
yes
no
yes
output
terminator
yes
no
yes
output
initiator*
no
no
yes
intercharacter
delay
yes
yes
yes
*If an output initiator is required on enquiry character responses, it should be
specified as the first character of the acknowledgment string and/or the
immediate response string, depending on the system.
MMililiyi See ESC . I and ESC . N.
The Set Handshake Mode 2 Instruction,
ESC. I
DESCRIPTION
The set handshake mode 2 instruction, ESC . I, may be
used with the enquire/acknowledge or Xon-Xoff handshake to establish
parameters for the plotter’s communication format.
1IK1M ft establishes the data block size, the enquiry character, and
the acknowledgment string for the enquire/acknowledge handshake
when the computer expects only the turnaround delay, and not the
other parameters set by ESC . M, to be included in the response to the
enquiry character. It sets the Xoff threshold level and the Xon trigger
character for Xon-Xoff handshake.
. I [ «DEC» ; «ASC» ; «ASC>(;. . . <ASC») ]:
SYNTAX
DEFAULT
1223 . I: (or KH3 . H:) Neither Xon-Xoff nor enquire/
acknowledge handshake is enabled. Block size is 80 bytes, and there is
no enquiry character or acknowledgment string. If, however, the com¬
puter is configured to send an ENQ anytime it is ready to send data to
RS-232-C/CCITT V.24 INTERFACING 10-33
the plotter, the plotter will automatically respond with ACK when it
receives ENQ. This “dummy handshake” is not dependent upon avail¬
able buffer space and does not protect against buffer overflow.
EXPLANATION
The two instructions, ESC . I and ESC . H, are mu¬
tually exclusive. With handshake mode 2, the only parameter of the
ESC . M instruction used when responding to the enquiry or Xon
trigger character is the turnaround delay. Refer to the chart under the
ESC . H instruction to see which parameters are used in various plotter
output situations. Choose your mode using ESC . I or ESC . H, depend¬
ing on the requirements of your system.
The parameters for both ESC . H and ESC . I are the same and are
described below, first as interpreted for the enquire/acknowledge hand¬
shake and then as interpreted for the Xon-Xoff handshake.
For Enquire/Acknowledge Handshake
<DEC> This first parameter specifies the block size; its range
is 0 to 9999. A parameter equal to or greater than 1024
is interpreted as 1024. Default block size set when the
parameter is omitted is 80 bytes.
<ASC> This parameter sets the enquiry character. The pa¬
rameter may be the decimal equivalent of any ASCII
character in the range 0 to 127. If the parameter is
omitted, it assumes the default value 0 (NULL charac¬
ter) disabling enquire/acknowledge handshake. Any
value other than 0 enables enquire/acknowledge hand¬
shake. However, the value 5 (enquire character, ENQ) is
generally used.
<ASC> . .. <ASC> This is a list of 1 to 10 parameters, separated by
semicolons, which specify the acknowledgment string.
Decimal equivalents of ASCII characters 0 to 127 are
valid. The value 0 is not transmitted and will terminate
the string. The value 6 (acknowledge character, ACK) is
generally used. If the parameter is omitted, it assumes
its default value and no characters are sent.
For Xon-Xoff Handshake
<DEC> This first parameter sets the Xoff threshold level by
specifying the number of empty bytes remaining in the
buffer when the Xoff character is to be sent. The practi¬
cal range is 10 to 1023. If the Xoff parameter is specified
to be greater than 512 (half the buffer size), the Xon
threshold level will be reset (from its automatic setting
of half the buffer size) so that the Xon character will be
sent when one byte more than the Xoff level is available.
10-34 RS-232-C/CCITT V.24 INTERFACING
<ASC> This parameter should be omitted by entering only the
semicolon or the value 0 followed by the semicolon. To
enable Xon-Xoff handshake, the next parameter, which
specifies an Xon trigger character(s), must be included.
<ASC> ... <ASC> This is a list of from 1 to 10 parameters, separated
by semicolons, which specify the Xon trigger charac¬
ters). Decimal equivalents of ASCII characters 0 to 127
are valid. The value 0 is not transmitted and will termi¬
nate the string.
EXAMPLES
See also the ESC . N instruction.
For Enquire/Acknowledge Handshake
- H 132; 19; 20; 7: will set the block size to 132 bytes, the ASCII
character DC3 as the enquiry character, and the two characters, DC4
and Bell, as the acknowledgment string. Since ESC. H sets handshake
mode 1, the currently defined output initiator, output terminator, output
trigger character, and echo terminator, as well as both turnaround
delay and inter character delay, are used when the response string, DC4
Bell, is sent.
. I; 5; 6: will set the block size to its default value of 80 bytes, the
ASCII character ENQ as the enquiry character, and the single ASCII
character ACK as the acknowledgment string. Only the turnaround
delay, intercharacter delay, and immediate response string, if any, are
used when sending the response. No output initiator will precede it,
even if one is defined, and no output terminator will follow it.
For Xon-Xoff Handshake
. 181;; 17: will set the Xoff threshold level to 81 (the Xoff character
will be sent when 81 empty bytes remain in the plotter’s buffer) and set
the Xon trigger character to DCl. The second parameter is defaulted as
required for this handshake. The Xoff trigger character must be set
using the ESC . N instruction. Transmittal of the Xon and Xoff trigger
characters is subject only to turnaround and intercharacter delays, if
any are specified. No output initiator will precede them, even if one is
defined, and no output terminator will follow them.
The Abort Device Control Instruction,
ESC. J
DESCRIPTION
The abort device control instruction, ESC . J, aborts
any device control instruction that may be partially decoded or executed.
UhlM This instruction may be used in an initialization sequence
when you first access the plotter.
RS-232-C/CCITT V.24 INTERFACING 10-35
SYNTAX
reg . j
EXPLANATION
This instruction aborts any single device control instruc¬
tion that may be partially decoded or executed. Unspecified parameters
of aborted instructions are defaulted. All pending or partially trans¬
mitted output requests, from either HP-GL or device control instructions,
are immediately terminated, including output responses and handshake
parameters. Intermediate output operations such as turnaround delay
and echo suppression are aborted, and the buffer input is enabled. The
handshake and output mode parameters remain as specified.
The Abort Graphic Instruction, ESC . K
DESCRIPTION
The abort graphic instruction, ESC . K, aborts any
partially decoded HP-GL instruction and discards instructions in the
buffer.
The instruction can be used as part of an initialization sequence
when starting a new program or to terminate plotting of HP-GL
instructions in the buffer.
SYNTAX
[S3. K
EXPLANATION
Any partially decoded HP-GL instruction is aborted
and all instructions in the buffer are discarded. A partially executed
instruction is allowed to finish.
The Output Buffer Size Instruction, ESC . L
DESCRIPTION
The output buffer size instruction, ESC . L, outputs the
size, in bytes, of the plotter’s buffer.
HmM The instruction is used to obtain information on the size of the
plotter’s buffer. This information might be used to determine parameters
of instructions which set up handshaking.
SYNTAX
rera . L
EXPLANATION
No parameters are used. The instruction causes the
7475 to output, in ASCII, a decimal number equal to the number of
bytes in the plotter’s buffer.
RESPONSE
<DEC>
TERM
1024
Defaults to carriage return, CR, or is as set by ESC . M.
NOTE: It is not advisable to use the ESC . L instruction when in block
mode as it may disrupt communication. If you use an ESC . L instruction
while in block mode, use it immediately after an ESC . E instruction.
10-36 RS-232-C/CCITT V.24 INTERFACING
Send the ESC . E instruction, read the response, send the ESC . L
instruction, read the response, and then send the additional HP-GL
instructions. ■
The Set Output Mode Instruction, ESC . M
DESCRIPTION
_ The set output mode instruction, ESC . M, establishes
parameters for the plotter’s communication format.
BIBiM The instruction is used to establish a turnaround delay, an
output trigger character, an echo terminate character, and an output
initiator character. It is also used to change the output terminator from
its default value, carriage return.
SYNTAX
S3 . M[«DEC»;«ASC»;«ASC»;«ASC>(;«ASC»)
; «ASC» ]:
DEFAULT
M: Sets the carriage return character (decimal equiva¬
lent 13) as the output terminator. It also specifies that there is no
turnaround delay and no output trigger, echo terminate, or output
initiator character .
A colon must be used following the last parameter (if
any). Use of the instruction without parameters is equivalent to
ESC. M: (see DEFAULT).
A description of the instruction’s parameters follows.
<DEC> The first parameter is optional. If present, it is the
turnaround delay. The delay implemented is ((parame¬
ter X 1.1875)mod 65 536)/1.2 milliseconds. The parameter
range is 0 to 54 612 milliseconds. If parameters follow,
the semicolon must be included even if this decimal
parameter is omitted.
<ASC> The second parameter is also optional and, if omitted,
assumes its default value of 0 (no trigger character). If
included, it specifies a single character which becomes
the output trigger character. The parameter may be
the decimal equivalent of any ASCII character in the
range 0 to 127. If parameters follow, the semicolon must
always be included, even when this parameter is omitted.
<ASC> The third parameter is optional and, if omitted, assumes
its default value 0 (no echo terminate character). If
included, it specifies a single character which becomes
the echo terminate character. The parameter may be
the decimal equivalent of any ASCII character in the
range 0 to 127. If parameters follow, the semicolon must
always be included, even when this parameter is omitted.
RS-232-C/CCITT V.24 INTERFACING 10-37
<ASC> . . . <ASC> The fourth parameter is optional and defaults to
13, the decimal equivalent of the single ASCII character,
carriage return.
If included, the parameter may be the decimal equiva¬
lents) of one or two ASCII characters in the range 0 to
127. This becomes the output terminator. The value 0
is not transmitted and will terminate the string. If a
parameter follows, the semicolon must always be in¬
cluded, even when this parameter is omitted. If the fifth
parameter is specified, this fourth parameter must con¬
sist of two characters, or the second character must be
specified as null using the semicolon.
<ASC>
EXAMPLES
The fifth parameter is optional and, if omitted, assumes
its default value 0 (no output initiator character). If
included, it is the decimal equivalent of a single charac¬
ter which becomes the output initiator character. The
parameter may be the decimal equivalent of any ASCII
character in the range 0 to 127. The parameter is fol¬
lowed by a colon.
See the ESC . N instruction.
The flowchart on the next page depicts plotter output.
The Set Extended Output and Handshake
Mode Instruction, ESC . N
DESCRIPTION
The set extended output and handshake mode instruc¬
tion, ESC . N, establishes parameters for the plotter’s communication
format.
HKlyf The instruction is used to specify an intercharacter delay in
all handshake modes, the immediate response string for enquire/
acknowledge handshake, or the Xoff trigger character(s) for the Xon-
Xoff handshake.
SYNTAX
DEFAULT
. N [ «DEC» ; (<ASC>(;... <ASC») ]:
. N : No intercharacter delay and no Xoff trigger char¬
acter or immediate response string.
B32EEEQQ3 A colon must be used following the last parameter.
Use of the instruction without parameters is equivalent to ESC . N:
(see DEFAULT).
10-38 RS-232-C/CCITT V.24 INTERFACING
Output Request Flow Chart
RS-232-C/CCITT V.24 INTERFACING 10-39
A description of the instruction’s parameters follows:
<DEC> The first parameter is optional. If present, it is the
intercharacter delay. The delay implemented is ((parame¬
ter X 1.1875)mod 65 536)/1.2 milliseconds. The parameter
range is 0 to 54 612 milliseconds. If parameters follow,
the semicolon must be included, even if this decimal
parameter is omitted.
<ASC> . . . <ASC> This parameter is optional. If present, it is a list
of the decimal equivalents of 1 to 10 ASCII characters
in the range 0 to 127. For Xon-Xoff handshake mode,
it specifies the Xoff trigger character(s). For enquire/
acknowledge handshake mode, it specifies the imme¬
diate response string. Semicolons must separate each
parameter in the list.
EXAMPLES
For Xon-Xoff Handshake
EEH . N; 19: Sets the Xoff trigger character to DC3. There will be no
intercharacter delay, since the first parameter is defaulted to zero by
the semicolon.
For Enquire/Acknowledge Handshake
The examples given here include all handshaking instructions. In
addition to illustrating the use of intercharacter delays and immediate
response strings set by ESC . N, they are designed to clarify the
difference between handshake mode 1 and mode 2 and give some
insight into why certain values are logical choices for some parameters.
The first BASIC program can be used as a handshake for the Apple II
Plus computer with the A2B0005 serial interface card installed in slot
#1 and baud rate set at 2400. Note the CHR$ function is used to send
the escape character.
10 DIM 0 U T $ ( 8 0 )
20 I N# 1
30 PR#1
40 PRINT CHR$(27);" .M0;63;0;13:";CHR$(27);".N5:"
50 PRINT CHR$(27);". H80;18;49:"
60 0UT$="IN;SP1;PR500,500;":GOSUB 100
100 PRINT CHR$(18): INPUT Z: PRINT GUT$: RETURN
The following parameters are set in lines 40 and 50:
turnaround delay = 0,
output trigger character = ? (decimal equivalent 63),
no echo terminate character,
10-40 RS-232-C/CCITT V.24 INTERFACING
output terminator = carriage return (decimal equivalent 13),
intercharacter delay = 5,
no immediate response string,
block size = 80,
enquiry character = DC2 (decimal equivalent 18), and
acknowledgment string = 1 (decimal equivalent 49).
The subroutine in line 100 controls the handshaking. It causes the
following chronological action. The enquiry character, DC2, is sent
asking if the plotter has room for an 80-byte block. The plotter does not
send an immediate response because that has been specified as null by
its omission in the ESC . N instruction. The plotter holds its response
until after it receives the output trigger character, ?. The question mark
is sent by the computer when it interprets the BASIC statement
INPUT to prompt for the input, Z. Z is the variable into which the
acknowledgment string, 1, is read. If the acknowledgment string had
been specified to contain nonnumeric characters, a string variable such
as Z$ would have been used instead of Z.
The plotter waits approximately five milliseconds, the intercharacter
delay, before sending the 1 and between the 1 and the output terminator,
carriage return. Note the carriage return parameter could have been
omitted, but carriage return still would have been sent as the output
terminator because that is the default value for output terminator. If
ESC . I had been used instead of ESC . H, the output terminator would
not have been sent after the acknowledgment string (but it would
follow responses to HP-GL output instructions). The carriage return
character is a logical choice, because it is expected by the computer to
delineate the end of data read by the INPUT statement.
The computer is now free to send the string OUT$, which contains HP-
GL instructions, to the plotter. Note the enquiry character must be sent
each time data is sent to the plotter.
Another handshake which would work using ESC . I is
40 PRINT CHR$(27);" .180;7;33;13:"
50 PRINT CHR$(27);" .M 500:";CHR$(27); “ .N5 : "
100 PRINT CHR$(7):INPUT Z$: PRINT 0UT$: RETURN
RS-232-C/CCITT V.24 INTERFACING 10-41
The following parameters are established:
turnaround delay = 500,
no output trigger character,
no echo terminate character,
output terminator = default value, carriage return,
intercharacter delay = 5,
no immediate response string,
block size = 80,
enquiry character = bell (decimal equivalent 7), and
acknowledgment string = ! carriage return (decimal equivalent 33,
13)
Now the computer sends the Bell character as the enquiry character.
The plotter waits approximately 505 milliseconds, the total of the
turnaround delay and the intercharacter delay, before sending its
response. During that time, the computer will send the ? due to the
INPUT statement, but the plotter ignores it. The plotter response to the
enquiry character is now two characters, ! followed by a carriage
return. The carriage return to terminate INPUT is now part of the
acknowledgment string. No output terminator, now defaulted to carriage
return, is sent because handshake mode 2 is set here by ESC . I. The
output terminator, carriage return, will still follow all responses to HP-
GL output instructions.
The Output Extended Status Instruction,
ESC . O
EH3M1 The output extended status instruction, ESC . O, outputs
the plotter’s extended status, giving information about the state of the
buffer, pinch wheels, and view button.
HKlM The instruction can be used to determine, from a remote
location, if the plotter is ready to plot.
SYNTAX
1133.0
EXPLANATI
ina No parameters are used. Unlike the HP-GL output
status instruction, OS, the ESC . O instruction does not enter the buffer
but is executed immediately, subject to any turnaround or inter character
delays specified by ESC . M and ESC . N.
10-42 RS-232-C/CCITT V.24 INTERFACING
RESPONSE
<DEC> The response is the decimal equivalent of a 6-bit imme¬
diate status word, followed by the output terminator.
The maximum value output is 40.
The extended status word bits are as defined in the
following table.
Bit
State
Decimal
Value
Meaning
0-2
0
0
Not used, always zeros. Re¬
served for plotters with
paper advance.
3
0
0
Buffer is not empty.
1
8
Buffer is empty and ready
for data.
4,5
00
0
Ready to process or process¬
ing HP-GL instructions.
01
16
Paper loaded, VIEW button
pressed so graphics sus¬
pended.
10
32
Paper lever raised so graph¬
ics suspended.
Combinations of these bits allow five different responses
to the ESC . O instruction.
Response
Meaning
0
Buffer is not empty and plotter is process¬
ing HP-GL instructions.
8
Buffer is empty and is ready to process
or is processing HP-GL instructions.
16
Buffer is not empty and view has been
pressed.
24
Buffer is empty and view has been
pressed.
32
Buffer is not empty and paper lever and
pinch wheels are raised.
40
Buffer is empty and paper lever and
pinch wheels are raised.
TERM The output terminator defaults to carriage return unless
it is set by ESC . M.
RS-232-C/CCITT V.24 INTERFACING 10-43
The Reset Handshake Instruction,
ESC . R
EHHI The reset handshake instruction, ESC . R, resets all
handshake parameters to their default values.
lIKiyi The instruction may be used to set the plotter’s handshake
responses to a known state with hardwire handshake enabled.
SYNTAX
EXPLANATI
153. R
M Executing this instruction is the same as executing the
following instructions without parameters: ESC . ESC . H, ESC . I,
ESC . M, and ESC . N. Executing this instruction, however, does not
reset the HP-GL graphic instructions that may have already been sent.
The following table shows the default values of parameters used to
establish handshakes.
Parameter
Value
block size
80
enquiry character
0 — no handshake enable character
acknowledgment string
0 — no handshake response string
turnaround delay
0
output trigger character
0 — no trigger character
echo terminate character
0 — no echo terminate character
output terminator
13; 0; — carriage return
output initiator
0 — no output initiator
inter character delay
0 — no delay
immediate response string
0 — no immediate response string
monitor mode
disabled
hardwire handshake (pin 20)
enabled
buffer size
1024
Xon level
512
normal data transfer mode
enable
block data transfer mode
disable
10-44 RS-232-C/CCITT V.24 INTERFACING
Appendix aT\
An HP-IB Overview
The HP Interface Bus (HP-IB) provides an interconnecting channel for data
transfer between devices on the HP-IB.
The following list defines the terms and concepts used to describe HP-IB
(bus) system operations.
HP-IB System Terms
1. Addressing — the characters sent by a controlling device specify¬
ing which device sends information on the bus and which device(s)
receives the information.
2. Byte — a unit of information consisting of 8 binary digits (bits).
3. Device — any unit that is compatible with the ANSI/IEEE
488-1978 Standard.
4. Device Dependent — a response to information sent on the HP-IB
that is characteristic of an individual device’s design, and may vary
from device to device.
5. Operator — the person that operates either the system or any
device in the system.
6. Polling — the process typically used by a controller to locate a
device that needs to interact with the controller. There are two types
of polling:
• Serial Poll — a method which obtains one byte of operational
information about an individual device in the system. The process
must be repeated for each device from which information is desired.
• Parallel Poll — a method for obtaining information about a
group of devices simultaneously.
Interface Bus Concepts
Devices which communicate along the interface bus can be classified
into three basic categories.
1. Talkers — devices which send information on the bus when they
have been addressed.
AN HP-IB OVERVIEW A-l
2. Listeners — devices which receive information sent on the bus
when they have been addressed.
3. Controllers — devices that can specify the talker and listeners for
an information transfer. Controllers can be categorized as one of two
types:
• Active Controller — the current controlling device on the bus.
Only one device can be the active controller at any time.
• System Controller — the only controller that can take priority
control of the bus if it is not the current active controller. Although
each bus system can have only one system controller, the system
can have any number of devices capable of being the active
controller.
A typical H1P-IB system is shown below.
Message Concepts
Devices which communicate along the interface bus are transferring
quantities of information. The transfer of information can be from one
device to another device, or from one device to more than one device.
These quantities of information can easily be thought of as “messages.”
In turn, the messages can be classified into 12 types. The list below
gives the 12 message types for the HP-IB.
1. The Data Message. This is the actual information which is sent
from one talker to one or more listeners along the interface bus.
2. The Trigger Message. This message causes the listening device(s)
to perform a device-dependent action when addressed.
3. The Clear Message. This message causes either the listening de-
vice(s) or all of the devices on the bus to return to their predefined
device-dependent states.
A-2 AN HP-IB OVERVIEW
4. The Remote Message. This message causes all devices currently
addressed to listen to switch from local front-panel control to
remote program control.
5. The Local Message. This message clears the Remote Message
from the listening device(s) and returns the device(s) to local front-
panel control.
6. The Local Lockout Message. This message prevents a device
operator from manually inhibiting remote program control.
7. The Clear Lockout/Local Message. This message causes all
devices on the bus to be removed from Local Lockout and revert to
Local. This message also clears the Remote Message for all devices
on the bus.
8. The Require Service Message. A device can send this message
at any time to signify that the device needs some type of interaction
with the controller. This message is cleared by sending the device’s
Status Byte Message if the device no longer requires service.
9. The Status Byte Message. A byte that represents the status of
a single device on the bus. Bit 6 indicates whether the device sent a
Require Service Message, and the remaining bits indicate opera¬
tional conditions defined by the device. This byte is sent from a
talking device in response to a serial poll operation performed by a
controller.
10. The Status Bit Message. This byte represents the operational
conditions of a group of devices on the bus. Each device responds
on a particular bit of the byte thus identifying a device-dependent
condition. This bit is typically sent by devices in response to a
parallel poll operation.
The Status Bit Message can also be used by a controller to specify
the particular bit and logic level at which a device will respond
when a parallel poll operation is performed. Thus, more than one
device can respond on the same bit.
11. The Pass Control Message. This transfers the bus management
responsibilities from the active controller to another controller.
12. The Abort Message. The system controller sends this message
to unconditionally assume control of the bus from the active con¬
troller. This message terminates all bus communications (but does
not implement a Clear Message).
These messages represent the full implementation of all HP-IB system
capabilities. Each device in a system may be designed to use only
the messages that are applicable to its purpose in the system. It is
AN HP-IB OVERVIEW A-3
important for you to be aware of the HP-IB functions implemented on
each device in your HP-IB system to ensure the operational compati¬
bility of the system.
The HP Interface Bus
HP-IB Lines and
Operations
The HP Interface Bus trans¬
fers data and commands be¬
tween the components of an
instrumentation system on
16 signal lines. The interface
functions for each system
component are performed
within the component so
only passive cabling is
needed to connect the sys¬
tems. The cables connect all
instruments, controllers, and
other components of the sys¬
tem in parallel to the signal
lines.
The eight Data I/O lines
(DIOl through DI08) are
reserved for the transfer
of data and other messages
in a byte-serial, bit-parallel
manner. Data and message
transfer is asynchronous,
coordinated by the three
handshake lines: Data Valid
(DAV), Not Ready For Data
(NRFD), and Not Data
Accepted (NDAC). The other
five lines are for manage¬
ment of bus activity. See the
figure on the right.
HP-IB Signal Lines
Devices connected to the bus may be talkers, listeners, or controllers.
The controller dictates the role of each of the other devices by setting
the ATN (attention) line true and sending talk or listen addresses on
the data lines. Addresses are set into each device at the time of system
configuration either by switches built into the device or by jumpers on
A-4 AN HP-IB OVERVIEW
a PC board. While the ATN line is true, all devices must listen to the
data lines. When the ATN line is false, only devices that have been
addressed will actively send or receive data. All others ignore the data
lines.
Several listeners can be active simultaneously but only one talker can
be active at a time. Whenever a talk address is put on the data lines
(while ATN is true), all other talkers will be automatically unaddressed.
Information is transmitted on the data lines under sequential control of
the three handshake lines (DAV, NRFD, and NDAC). No step in the
sequence can be initiated until the previous step is completed. Informa¬
tion transfer can proceed as fast as devices can respond, but no faster
than allowed by the slowest device presently addressed as active. This
permits several devices to receive the same message byte concurrently.
The ATN line is one of the five bus management lines. When ATN is
true, addresses and universal commands are transmitted on only seven
of the data lines using the ASCII code. When ATN is false, any code of
eight bits or less understood by both talker and listener(s) may be used.
The IFC (interface clear) line places the interface system in a known
quiescent state.
The REN (remote enable) line is used with the Remote, Local, and
Clear Lockout/Set Local messages to select either local or remote con¬
trol of each device.
Any active device can set the SRQ (service request) line true via the
Require Service Message. This indicates to the controller that some
device on the bus wants attention, such as a counter that has just com¬
pleted a time-interval measurement and wants to transmit the reading
to a printer.
The EOI (end or identify) line is used by a device to indicate the end of
a multiple-byte transfer sequence. When a controller sets both the ATN
and EOI lines true, each device capable of a parallel poll indicates its
current status on the DIO line assigned to it.
In the interest of cost-effectiveness, it is not necessary for every device
to be capable of responding to all the lines. Each can be designed to
respond only to those lines that are pertinent to its function on the bus.
The operation of the interface is generally controlled by one device
equipped to act as controller. The interface transmits a group of com¬
mands to direct the other instruments on the bus in carrying out their
functions of talking and listening.
The controller has two ways of sending interface messages. Multi-line
messages, which cannot exist concurrently with other multi-line
AN HP-IB OVERVIEW A-5
messages, are sent over the eight data lines and the three handshake
lines. Uni-line messages are transferred over the five individual lines of
the management bus.
The commands serve several different purposes:
• Addresses or talk and listen commands select the instruments that
will transmit and accept data. They are all multi-line messages.
• Universal commands cause every instrument equipped to do so to
perform a specific interface operation. They include multi-line mes¬
sages and three uni-line commands: interface clear (IFC), remote
enable (REN), and attention (ATN).
• Addressed commands (also referred to as primary commands) are
similar to universal commands, except that they affect only those
devices that are addressed and are all multi-line commands. An in¬
strument responds to an addressed command, however, only after an
address has already told it to be talker or listener.
• Secondary commands are multi-line messages that are always used
in series with an address, universal command, or addressed com¬
mand to form a longer version of each. Thus they extend the code
space when necessary.
To address an instrument, the controller uses seven of the eight data-
bus lines. This allows instruments using the ASCII 7-bit code to act as
controllers. As shown in the following table, five bits are available for
addresses, and a total of 31 allowable addresses are available in one
byte. If all secondary commands are used to extend this into a two-byte
addressing capability, 961 addresses become available (31 allowable
addresses in the second byte for each of the 31 allowable in the first
byte.)
Command and Address Codes
Code Form
Meaning
X
0
0 As A 4
A 3
A 2
Ai
Universal Commands
X
0
1 A 5 A 4
except
A 3
A 2
Ai
Listen Addresses
X
0
1 1 1
1
1
1
Unlisten Command
X
1
0 As A 4
except
A 3
A 2
Ai
Talk Address
X
1
0 1 1
1
1
1
Untalk Command
X
1
1 A 5 A 4
except
A 3
A 2
Ai
Secondary Commands
X
1
1 1 1
1
1
1
Ignored
Code used when attention (ATN) is true (low).
X don’t care.
A-6 AN HP-IB OVERVIEW
Interface Functions
Interface functions provide the physical capability to communicate via
HP-IB. These functions are defined in the ANSI/IEEE 488-1978
Standard. This standard, which is the designer’s guide to the bus,
defines each interface function in terms of state diagrams that express
all possible interactions.
Bus capability is grouped under 10 interface functions, for example:
Talker, Listener, Controller, Remote/Local. The following table lists the
functions, including two special cases of Controller.
HP-IB Interface Functions
Mnemonic
Interface Function Name
SH
Source Handshake
AH
Acceptor Handshake
T
Talker (or TE = Extended Talker)*
L
Listener (or LE = Extended Listener)*
SR
Service Request
RL
Remote Local
PP
Parallel Poll
DC
Device Clear
DT
Device Trigger
C
Any Controller
C N
A Specific Controller (for example: C A , C B ...)
C s
The System Controller
*Extended Talkers and Listeners use a two-byte address. Otherwise, they are
the same as Talker and Listener.
AN HP-IB OVERVIEW A-7
Bus Messages
Since interface functions are the physical agency through which bus
messages are implemented, each device must implement one or more
functions to enable it to send or receive a given bus message.
The following table lists the functions required to implement each bus
message. Each device’s operating manual lists the functions imple¬
mented by that device. Some devices, such as the 98034A Interface, list
the functions implemented directly on the device.
Functions Used by Each Bus Message
Bus Message
Functions Required
sender function — receiver function(s)
(support functions)
Data
T - L* (SH, AH)
Trigger
C - DT* (L, SH, AH)
Clear
C - DC* (L, SH, AH)
Remote
C s - RL* (SH, AH)
Local
C - RL* (L, SH, AH)
Local Lockout
C - RL* (SH, AH)
Clear Lockout/Set Local
C s - RL*
Require Service
SR* - C
Status Byte
T - L* (SH, AH)
Status Bit
PP* - C
Pass Control
C A - C B (T, SH, AH)
Abort
C s - T, L*C
*Since more than one device can receive (or send) this message simultaneously,
each device must have the function indicated by an * .
A-8 AN HP-IB OVERVIEW
Appendix
Instruction Syntax
HP-GL Syntax
This section lists the formal syntax for each plotter instruction in
alphabetical order of the instruction’s two-letter mnemonic.
Each instruction is listed with its purpose, syntax, parameter or re¬
sponse type, and range. If no parameter range is given, the range is
-2 15 to 2 15 -1. Refer to the indicated pages for details. The semicolon is
included as the terminator for all instructions except the label instruc¬
tions. The next mnemonic can also be used as the instruction termina¬
tor. In addition, if you have an HP-IB plotter, the line feed character
can be used as a terminator. TERM means the terminator sent by the
plotter at the end of output. It is CRLF in an HP-IB configuration and
CR or as set by an ESC. M instruction in an RS-232-C configuration.
AA The Arc Absolute Instruction Page 3 16
AA X-coordinate,Y-coordinate,arc angle(,chord angle);
Purpose: Draws arc of specified number of degrees with specified
smoothness; centered at X,Y coordinate, using current
pen status (up or down).
Parameters: X- and Y-coordinates — integer, in plotter units unless
scaling in effect; then in user units.
arc angle — integer, negative value specifies clockwise
arc, positive value specifies counterclockwise arc.
chord angle — integer, defines arc smoothness in degrees.
Default is 5 degrees.
INSTRUCTION SYNTAX B-l
AR
CA
Cl
The Are Relative Instruction Page 3-18
AR X-increment,Y-increment,arc angle(,chord angle);
Purpose: Draws arc of specified number of degrees with specified
smoothness; centered relative to current pen position,
using current pen status (up or down).
Parameters: X- and Y-increments — integer, in plotter units unless
scaling in effect; then in user units.
arc angle — integer, negative value specifies clockwise
arc, positive value specifies counterclockwise arc.
chord angle — integer, defines arc smoothness in degrees.
Default is 5 degrees.
The Designate Alternative Character Set
Instruction
Page 5-3
CP
CA n;
Purpose: Designates the alternate character set.
Parameter: integer 0-4, 6-9, or 30-39; default set 0.
The Circle Instruction Page 3-11
Cl radius(,chord angle);
Purpose: Draws a circle of specified radius centered at current pen
position.
Parameters: radius — integer, in plotter units unless scaling in effect;
then in user units. Starting point at 0 degrees with
positive parameter; 180 degrees with negative parameter.
chord angle — integer, defines circle smoothness in de¬
grees. Default is 5 degrees.
The Character Plot Instruction Page 5-14
CP spaces, lines;
Purpose: Move the pen the number of spaces and lines specified.
Parameters: spaces — decimal, ^ -128 and < 128, number of CP
spaces, positive value moves pen in current label direc¬
tion, negative value moves pen in opposite direction.
lines — decimal, ^ -128 and < 128, number of CP lines,
positive value moves pen up, negative value moves pen
down in relation to current label direction.
Omitting parameters causes carriage return, line feed.
B-2 INSTRUCTION SYNTAX
Page 5-3
CS The Designate Standard Character Set
Instruction
CS m ;
Purpose: Designates the standard character set.
Parameter: integer, 0-4, 6-9 or 30-39; default set 0.
DC The Digitize Clear Instruction Page 6-3
DC ;
Purpose: Clears digitize mode without entering a point from the
front panel.
DF The Default Instruction Page l-ll
DF ;
Purpose: Returns plotter to default conditions. See the table in
Appendix C.
DI The Absolute Direction Instruction Page 5 10
DI run, rise;
Purpose: Sets the direction of labels.
Parameters: run, rise — decimal values, unitless. At least one must be
nonzero, i.e., | parameter | ^ 0.0004 .
Omitting parameters causes horizontal labels and is the
same as DI 1,0.
DP The Digitize Point Instruction Page 6-2
DP ;
Purpose: Places plotter in digitize mode waiting for point to be
entered from front panel.
DR The Relative Direction Instruction Page 5-11
DR run, rise;
Purpose: Sets the direction of labels.
Parameters: decimals, -128.0000 to +127.9999.
run is % of (P2 X - Plx), rise is % of (P2 y - Ply).
Omitting parameters causes horizontal labels as does
DR 1,0.
INSTRUCTION SYNTAX B-3
DT The Define Terminator Instruction
Page 5-5
DT t;
Purpose: Defines the label terminator used in LB instruction.
Parameter: ASCII character 1 to 127 except 5 and 27. Only an IN or
DF instruction or use of ETX (decimal 3) as parameter
restores label terminator to ETX, its default value.
EA The Edge Rectangle Absolute Page 3-25
Instruction
EA X-coordinate, Y-coordinate ;
Purpose: Draws the edge of a rectangle in absolute coordinates.
Parameters: X- and Y-coordinates
Maximum parameters — decimal, -32 768.0000 through
32 767.9999. In plotter units unless scaling in effect; then
in user units. When scaling is off, parameters truncated
to integers.
ER The Edge Rectangle Relative Page 3-28
Instruction
ER X-increment, Y-increment;
Purpose: Draws the edge of a rectangle using relative coordinates.
Parameters: X-increment, Y-increment;
Maximum parameters — decimal, -32 768.0000 through
32 767.9999. In plotter units unless scaling in effect; then
in user units. When scaling is off, parameters truncated
to integers.
EW The Edge Wedge Instruction Page 3-34
EW radius, start angle, sweep angle(,chord angle);
Purpose: Draws the edge of a wedge.
B-4 INSTRUCTION SYNTAX
Parameters:
Parameter
Type
Range
Default
radius
integer/
decimal
-32 768.0000-
+32 767.9999
none
start angle
integer
MOD 360
none
sweep angle
integer
-32 768-
+32 767
none
chord angle
integer
1-120
5°
radius — in plotter units unless scaling in effect; then in
X-axis user units. The sign of the radius defines the zero-
degree reference point for the start angle and sweep
angle.
start angle — a positive start angle positions the radius
CCW from the zero-degree reference point; a negative
start angle positions the radius CW from the zero-degree
reference point.
sweep angle — a positive sweep angle draws the arc
segment CCW; a negative sweep angle draws the arc
segment CW.
FT The Fill Type Instruction Page 3-21
FT (type(,spacing(,angle)));
or
FT ;
Purpose:
Parameters:
Selects a type of area fill for use with an RA, RR, or WG
instruction.
Parameter
Number
Type
Range
Default
fill type
integer
1-5
1
spacing
decimal
0-32 767.9999
(current
units)
1% of the
diagonal
distance
between PI
and P2
angle
integer
±45°
increments
from 0°
0°
INSTRUCTION SYNTAX B-5
A O-degree angle will produce horizontal lines, a 90-
degree angle will produce vertical lines, and a 45-degree
angle will produce angular lines.
IM The Input Mask Instruction Page 114
IM E-mask value (, S-mask value(, P-mask value));
Purpose: Set masks to specify which errors will cause the ERROR
LED to come on and bit 5 of the status byte to be set,
and to specify what conditions will cause a positive
response to a serial or parallel poll in an HP-GL
environment.
Parameters: integers 0 through 255. If parameters omitted, masks are
set to 223,0,0, the default values.
IN The Initialize Instruction Page 1-13
IN ;
Purpose: Sets the plotter to default conditions plus raises the
pen, clears all HP-GL errors, and sets bit 3 of the output
status byte to true (1).
The scaling points PI and P2 are set as follows:
Paper
Size
Scaling Points (Plotter Units)
Plx,Ply
P2x,P2y
A
250,596
10 250,7796
A4
603,521
10 603,7721
B
522,259
15 722,10 259
A3
170,602
15 370,10 602
IP The Input PI and P2 Instruction Page 2-7
IP Plx, Ply (, P2 X , P2 y ) ;
Purpose: Sets scaling points.
Parameters: Integers in plotter units. Omitting parameters sets PI
and P2 to default values as listed above under the IN
instruction.
B-6 INSTRUCTION SYNTAX
Page 2-12
IW The Input Window Instruction
IW Xlower left, Ylower left, Xupper right, Yupper right 5
Purpose: Sets window inside which plotting can occur.
Parameters: Specify X- and Y-coordinates of lower-left and upper-right
corners of the window.
Omitting parameters sets window to maximum plotting
area, determined by the setting of the paper switches.
LB The Label Instruction Page 5-7
LB c... c t
Purpose: Draws the character string using the currently selected
character set.
Parameters: c . .. c — ASCII characters which may include control
characters.
Terminator: t — label terminator defined by DT. Default is ETX,
decimal 3.
LT The Line Type Instruction Page 4 6
LT pattern number (, pattern length);
Purpose: Sets the line type used in drawing lines.
Parameters: pattern number — integer between 0 and +6. Omitting
parameter causes solid line.
0- specifies dots only at the points that are plotted.
1 - *
2 - - - - -
3 ---- - - -
4 -
5 --
j_ One pattern length
No parameter (Default Value) ■
pattern length — decimal, 0 to 127.9999, a percentage of
diagonal distance between PI and P2. Default 4%.
INSTRUCTION SYNTAX B-7
Page 7-2
OA The Output Actual Position and
Pen Status Instruction
OA ;
Purpose: Used to output the pen’s physical position at time of
instruction.
Response: X,Y,P TERM — integers, in ASCII.
X,Y — in plotter units within current window.
P — 0, pen up or 1, pen down.
OC The Output Commanded Position and Page 7-3
Pen Status Instruction
OC ;
Purpose: Used to output the pen position and status at time of
instruction.
Response: X,Y,P TERM — decimal numbers, in ASCII.
X,Y — -32 768.0000 to 32 767.9999.
P — 0, pen up or 1, pen down.
Plotter units unless scaling in effect; then in user units.
OD The Output Digitized Point and Page 6-3
Pen Status Instruction
OD ;
Purpose: Used to output the physical pen position and status for
the last digitized point.
Response: X,Y,P TERM — integers, in ASCII.
X,Y — In plotter units, within mechanical limits.
P — 0, pen up or 1, pen down.
OE The Output Error Instruction Page 7-5
OE ;
Purpose: Used to output the first HP-GL error.
Response: error number TERM — a positive ASCII integer, 0
through 8, excluding 4 and 7.
B-8 INSTRUCTION SYNTAX
OF The Output Factors Instruction Page 7-6
OF ;
Response: 40, 40 TERM — integers, in ASCII.
OH The Output Hard-clip Limits Instruction Page 2-13
OH ;
Purpose: Used to output the lower-left and upper-right coordinates
of the hard-clip limits.
Response: Xlower left, Ylower left, Xupper right, Yupper right, TERM —
four ASCII integers in plotter units.
OI The Output Identification Instruction Page 7 6
OI ;
Purpose: Used to output the plotter’s identification.
Response: 7475A TERM — ASCII string.
OO The Output Options Instruction Page 7 6
00 ;
Purpose: Used to output features implemented on the plotter.
Response: 0,1,0,0,1,0,0,0 TERM
Indicates arcs and circle instructions are included .
•-Indicates pen select capability is included.
INSTRUCTION SYNTAX B-9
Page 2-8
OP The Output PI and P2 Instruction
OP ;
Purpose: Used to output the plotter unit coordinates of the scaling
points PI and P2.
Response: Pl x , Ply, P2 X , P2 y TERM — four integers in ASCII.
Range — dependent on combination setting of paper
switches.
Plotting Ranges
Paper
Size
Plotting Range
X-axis
Y-axis
A
0 ^ X ^ 10 365
0 ^ Y s? 7962
B
0s£ Xs$ 16 640
0 Y ^ 10 365
A4
0^ X^ 11 040
0s$ Ys? 7721
A3
0s$ Xs£ 16 158
0< X^ 11 040
OS The Output Status Instruction Page 7-7
OS ;
Purpose: Used to output the plotter’s status.
Response: status TERM — integer in ASCII in the range 0 to 255.
Power-on status, 24.
OW The Output Window Instruction Page 2 13
OW ;
Purpose: Used to output the plotter unit coordinates of the lower-
left and upper-right corners of the current window.
Response: Xlower left, Ylower left, Xupper right, Yupper right TERM —
integers in ASCII. Range same as OP.
B-10 INSTRUCTION SYNTAX
PA The Plot Absolute Instruction
Page 3-4
PA Xi coordinate, Yi coordinate (X 2 coordinate, Y 2 coordinate,
X n coordinate, Y n coordinate);
or
PA ;
Purpose: Plots to the X,Y coordinates in the order listed using the
current pen up/down status. PA ; sets absolute plotting.
Parameters: Pairs of integers representing plotter units if scaling not
in effect, otherwise user units, integers or decimals.
PD The Pen Down Instruction
PD ;
Page 3-2
or
PD Xi coordinate, Yi coordinate (,... X n , Y n coordinates);
Purpose: Programmatically lowers the pen. Parameters may be
included as in PA or PR.
PR The Plot Relative Instruction
Page 3-8
PR Xi increment, Yi increment (, X 2 increment, Y 2 increment,
X n increment, Y n increment) ;
or
PR ;
Purpose: Plots, in order, to the points indicated by the X,Y incre¬
ments, relative to the previous pen position. PR ; sets rela¬
tive plotting for PU or PD with parameters.
Parameters: Pairs of integers representing plotter units if scaling is
not in effect, otherwise user units, integers, or decimals.
PS The Paper Size Instruction Page 1-16
PS paper size;
Purpose: Can be used to toggle between A and B, or A3 and A4
paper sizes.
Parameters: 0-3 or 4-127; 0-3 selects either B or A3 size paper; 4-127
selects A or A4 size paper.
INSTRUCTION SYNTAX B-ll
Page 3-22
PT The Pen Thickness Instruction
PT (pen thickness);
or
PT ;
Purpose: Determines the spacing between the lines drawn in a
solid fill.
Parameters: Decimal between 0.1 mm-5.0 mm. If parameter is omitted,
defaults to .3 mm size.
PU The Pen Up Instruction Page 3-2
PU ;
or
PU Xi coordinate, Yi coordinate (, . .. X n , Y n coordinates);
Purpose: Programmatically raises the pen. Parameters may be in¬
cluded as in PA or PR.
RA The Shade Rectangle Absolute Page 3-23
Instruction
RA X-coordinate, Y-coordinate ;
Purpose: Defines and shades a rectangle using absolute coordinates.
Parameters: X- and Y-coordinates
Maximum parameters — decimal, -32 768.0000 through
32 767.9999. In plotter units unless scaling in effect; then
in user units. When scaling is off, parameters truncated
to integers.
RO The Rotate Coordinate System Page 2-14
Instruction
RO (angle in degrees);
or
RO ;
Purpose: Rotates the coordinate system 90 degrees.
Parameters: 0 or 90; 0 or omitting parameters turns off rotation; 90
rotates coordinate system 90 degrees.
B-12 INSTRUCTION SYNTAX
RR The Shade Rectangle Relative
Instruction
Page 3-26
RR X-increment, Y-increment;
Purpose: Defines and shades a rectangle using relative coordinates.
Parameters: X-increment, Y-increment;
Maximum parameters — decimal, -32 768.0000 through
32 767.9999. In plotter units unless scaling in effect; then
in user units. When scaling is off, parameters truncated
to integers.
SA The Select Alternate Character Set
Instruction
Page 5-4
SA ;
Purpose:
Selects the alternate character set designated by the CA
instruction as the character set to be used for subsequent
labeling.
SC The Scale Instruction
SC Xmin, Xmax, Ymin, Ymax ;
Purpose: Scales the plotting area into user units.
Parameters: Integers.
Page 2-9
SI The Absolute Character Size Instruction Page 5-16
SI width, height;
Purpose: Sets character width and height in centimetres for labels.
Parameters: width, height — decimals representing centimetres,
-128.0000 to +127.9999 .
An SI instruction with no parameters will default to the
following parameters based on the paper size:
Paper Size
Width
Height
A/A4
.187 cm
.269 cm
B/A3
.285 cm
.375 cm
INSTRUCTION SYNTAX B-13
SL The Character Slant Instruction Page 5-18
SL tan 0 ;
Purpose: Establishes the slant for labeled characters.
Parameters: decimal, —128.0000 to +127.9999, interpreted as the tan¬
gent of the angle from vertical.
Omitting parameters establishes no slant, the same as
the default or SL 0.
SM The Symbol Mode Instruction Page 4-4
SM character;
Purpose: Causes specified symbol to be drawn at each plotted
point.
Parameter: Any printing character ASCII 33 through 126 excluding
semicolon (ASCII 59). SM space, SM control character,
or SM; cancels symbol mode.
SP The Pen Select Instruction Page 3-3
SP pen number;
Purpose: Selects or stores a pen.
Parameter: integers. Omitting parameters or a parameter of 0 stores
the pen.
SR The Relative Character Size Instruction Page 5-17
SR width, height;
Purpose: Sets the character width and height relative to PI and
P2 for labels.
Parameters: decimals representing a percentage of vertical or hori¬
zontal distance between PI and P2.
Width — percentage of (P2 X - Plx).
Height — percentage of (P2 y - Ply).
Omitting parameters results in value 0.75 for width and
1.5 for height.
B-14 INSTRUCTION SYNTAX
Page 5-4
ss
TL
The Select Standard Character Set
Instruction
SS ;
Purpose:
Selects the standard character set designated by the CS
instruction as the character set used for subsequent
labeling.
The Tick Length Instruction
TL tp (, tn);
Purpose:
Page 4-2
Establishes the length of ticks drawn with the instruc¬
tions XT and YT.
Parameters: decimals.
tp — percentage of (P2 y - Ply) for XT or (P2 X - Plx) for
YT. Denotes portion above the X-axis or to the right of
the Y-axis when difference is positive.
tn — same as tp except denotes portion below the X-axis
and to the left of the Y-axis.
Omitting parameters causes tick lengths tp and tn 0.5%
of (P2 y - Ply) or (P2 X - Plx), the same as the default
values.
UC The User Defined Character Instruction Page 519
UC (pen control,) X-increment, Y-increment (,...) (, pen control)
(,...) ;
Purpose: Draws characters or symbols defined by user.
Parameters: pen control — ^ +99 pen down or ^ —99 pen up.
X-increment, Y-increment in grid units, range, ± 98 grid
units.
Omitting parameters causes a carriage return.
VS The Velocity Select Instruction Page 3-3
VS pen velocity ;
Purpose: Sets the pen velocity.
Parameters: decimal, 0 to 127.9999.
pen velocity — 1 through 38.1 interpreted as cm/s. De¬
faults to velocity of 38.1 cm/s, acceleration of 2 g. Any
velocity parameter slows acceleration to 0.5 g.
INSTRUCTION SYNTAX B-15
Page 3-31
WG The Shade Wedge Instruction
WG radius, start angle, sweep angle(,chord angle);
Purpose: Defines and fills a wedge.
Parameters:
Parameter
Type
Range
Default
radius
integer/
decimal
-32 768.0000-
+32 767.9999
none
start angle
integer
MOD 360
none
sweep angle
integer
-32 768-
+32 767
none
chord angle
integer
1-120
5°
radius — in plotter units unless scaling in effect; then in
X-axis user units. The sign of the radius defines the zero-
degree reference point for the start angle and sweep
angle.
start angle — a positive start angle positions the radius
CCW from the zero-degree reference point; a negative
start angle positions the radius CW from the zero-degree
reference point.
sweep angle — a positive sweep angle draws the arc
segment CCW; a negative sweep angle draws the arc
segment CW.
XT The X-Tick Instruction Page 4-2
XT ;
Purpose: Draws a vertical tick mark of the length specified by the
TL instruction at the current pen position.
YT The Y-Tick Instruction Page 4 2
YT ;
Purpose: Draws a horizontal tick mark of the length specified by
the TL instruction at the current pen position.
B-16 INSTRUCTION SYNTAX
RS-232-C Instruction Syntax
This section lists the formal syntax for each RS-232-C device control
instruction in alphabetical order of the escape sequence. Refer to the
indicated page for details.
Plotter On
. ( or
Page 10-26
Purpose: Places the plotter in a programmed-on state.
Plotter Off
rera .) or rera . z
Page 10-26
Purpose: Places the plotter in a programmed-off state.
Set Plotter Configuration Page 10 27
[S3 . @ [ «DEC>); (<DEC» ]:
Purpose: Enables or disables hardwire handshake mode, monitor
mode, and data transmission mode.
Parameters: <DEC> — Sets maximum buffer size.
<DEC> — Data Terminal Ready (CD) line control. A
decimal number in the range of 0-31.
Output Buffer Space Page 10-28
. b
Purpose: Outputs the number of byte spaces currently available for
data in the buffer.
Response: <DEC> TERM — 0 to 1024.
Output Extended Error
Page 10-29
Purpose: Outputs a decimal code to identify the type of RS-232-C
related error that occurred.
Response: <DEC> TERM — 0, no error, or 10 - 16.
INSTRUCTION SYNTAX B-17
Set Handshake Mode 1
Page 10-32
[S3 . H [«DEC» ; «ASC» ; «ASC>(;.. . <ASC») ]:
Purpose: Establishes parameters for handshake mode 1, used when
response to handshake enable character requires ESC . M
parameters.
Parameters: <DEC> — Block size or Xoff threshold level.
<ASC> — Handshake enable character or not used.
<ASC> . . . <ASC> — Handshake response string of 1 to
10 characters or Xon trigger characters.
Set Handshake Mode 2 Page 10-33
[S3 . I [«DEC» ; «ASC>); «ASC>(;... <ASC») ]:
Purpose: Establishes parameters for handshake mode 2, used when
response to handshake enable character does not require
ESC. M parameters.
Parameters: <DEC> — Block size or Xoff threshold level.
<ASC> — Handshake enable character or omitted.
<ASC> . . . <ASC> — Handshake response string of 1 to
10 characters or Xon trigger characters.
Abort Device Control Page 10-35
rera . j
Purpose: Aborts any partially decoded or executed device control
instructions including outputs.
Abort Graphic Instruction Page 10-36
Purpose: Aborts any partially decoded HP-GL instruction and dis¬
cards instructions in buffer.
Output Buffer Size Page 10-36
rera . l
Purpose: Outputs the buffer size.
Response: 1024. Not output until the buffer is empty.
B-18 INSTRUCTION SYNTAX
Set Output Mode Page 10-37
ma . M [«DEC» ; «ASC» ; «ASC» ; (<ASC>(; «ASC»);
«ASC>) ]:
Purpose: Sets parameters for output.
Parameters: <DEC> — Turnaround delay, 0-54 612.
<ASC> — Output trigger character, ASCII 0-127.
<ASC> — Echo terminator character, ASCII 0-127.
<ASC> . . . <ASC> — 1 or 2 output terminators, ASCII
0-127, 0 terminates string.
<ASC> — Output initiator character, ASCII 0-127.
Set Extended Output and Handshake Mode Page 10-38
[S3 . N [«DEC» ; KASCX ; .. . <ASC>))]:
Purpose: Establishes extended parameters for any output instruction.
Parameters: <DEC> — Delay between output characters, 0-54 612.
<ASC> .. . <ASC> — Immediate response string of 1 to
10 characters. ASCII 0-127, 0 terminates string; or Xoff
trigger characters.
Output Extended Status Page 10-42
[S3. ()
Purpose: Outputs the decimal equivalent value of a 16-bit immediate
status word.
Response: <DEC> TERM — a value 40 or less.
Reset Handshake Page 10-44
Purpose: Resets the handshake to its default value. It is the same
as sending the commands ESC. @, ESC. H, ESC. I,
ESC . M, and ESC . N without parameters.
INSTRUCTION SYNTAX B-19
Notes
Appendix
Reference Material
Binary Coding and Conversions
Binary is a base 2 number system using only l’s and 0’s. By giving the
l’s and 0’s positional value, any decimal number can be represented.
For example, this diagram shows how decimal 41 = binary 101001:
Decimal
4 x 10 1 + 1 x 10°
4 x 10 + 1 x 1
4 lio
Binary
IX 2 5 + 0 x 2 4 + 1 x 2 3 + 0 x 2 2 + 0 x 2 1 + 1 x 2°
IX 32 +0X16 +1X8 +0X4 +0X2 +1X1
1 0 1 0 0 12
Binary-Decimal Conversions
To convert from binary to decimal, the positional values of the l’s are
added up. From the above example, this would be:
2 5 + 2 3 + 2° = 32 + 8 + 1 = 41
To convert from decimal to binary, the decimal number is divided by 2.
The remainder is the binary equivalent. For example:
Remainder
(read up)
1
0
0 = Binary 101001
0
1
2 [41
2 [20
2 [To
2 nr
2 [~2
2 rr
REFERENCE MATERIAL C-l
Scaling Without Using the SC Instruction
The 7475 plotter movements are in terms of plotter units where a plotter
unit = 0.025 mm. While the plotter can be scaled into user units using
the SC instruction, it may be convenient for you to write programs
where numbers to be plotted are in some units other than plotter units.
These “user units” can be converted into plotter units by the computer
using the following equations:
Xscaled —
P2 X ~ Pl>
U2 X - UU
Ax + Plx Ulx
P2x — Plx
U2 X - Ulx
Yscaled —
P2 v - PU
U2y Uly
Ay + Ply - Ulv
P2y Ply
U2y - Uly
where: A x is the X-coordinate of the desired point in user units,
A y is the Y-coordinate of the desired point in user units,
Plx is the X-coordinate of PI in plotter units,
Ply is the Y-coordinate of PI in plotter units,
P2 X is the X-coordinate of P2 in plotter units,
P2 y is the Y-coordinate of P2 in plotter units,
Ulx is the X-coordinate of PI in user units,
Uly is the Y-coordinate of PI in user units,
U2 X is the X-coordinate of P2 in user units, and
U2 y is the Y-coordinate of P2 in user units.
To demonstrate the use of the scaling equations, let's go through an
example.
Example 1:
Problem
Scale the platen area (PI =250,596 and P2 = 10 250,7796) into
user units where PI = 0,0 and P2 = 25 000,18 000. At the center
point (X = 12 500, Y = 9000), draw a circle with radius 2500 as
shown on the following page.
C-2 REFERENCE MATERIAL
18 000
User
Units
Solution
A. Recall that the equations of a circle are:
X = R cos t
Y = R sin t
where 0 ^ t ^ 2 n
B. Since we are to plot relative to a point that is not at the origin,
an offset X 0 , Y 0 must be added to the circle equations. The
offset in user units is:
X 0 - 12 500
Y 0 - 9000
C. The desired circle equations are then:
A x = 2500 cos t + 12 500
A y = 2500 sin t + 9000
D. Determine the user scale:
X = 0 to 25 000
Y = 0 to 18 000
therefore
U1 X = 0
Uly — 0
U2 X = 25 000
U2 y = 18 000
REFERENCE MATERIAL C-3
E. Determine the values for PI and P2 which were set using the
IN instruction:
PI = 250,596
P2 = 10 250,7796
therefore
Plx = 250
Ply = 596
P2 X = 10 250
P2 y = 7796
F. Solving for X and Y:
P2 X Plx
U2 X — Ulx
A x + Plx Ulx
P2 X Plx
U2 X — Ulx
10 250 - 250
25 000 - 0
(2500 cos t + 12 500) + 250-0
10 250 - 250
25 000 - 0
= 0.4 (2500 cos t + 12 500) + 250-0
= 1000 cos t + 5250
Y =
P2 V - PI'
U2y - Ulv
Ay + Ply Uly
P2y-Pl,
U2y Uly
+
7796 - 596
18 000 - 0
(2500 sin t + 9000) + 596-0
7796 - 596
18 000 - 0
= 0.4 (2500 sin t + 9000) + 596-0
=- 1000 sin t+4196
G. Sending the following program will plot the required circle
using the default PI and P2.
10 PRINT "IP250,596,10250,7796;SP1
20 FOR T*0 TO 2*PI STEP PI/20
30 X«1OOO*C0S(T)+525O
40 Y-1000*SIN(T)+4196
50 PRINT "Pfl" ; X; Y j " PD"
60 NEXT T
70 PRINT "SPO;"
C-4 REFERENCE MATERIAL
Plotter Default Conditions
Plotting mode
Absolute (PA)
Relative character direction
Horizontal (DR 1,0)
Line type
Solid line
Line pattern length
4% of the distance from PI to P2
Fill type
Set to type 1 bidirectional solid fill
Fill spacing
1% of the diagonal distance between
PI and P2
Fill angle
Set to 0°
Input window
Mechanical limits of plotter
Relative character size
(SR .75,1.5)
width = 0.75% of (P2 X - PI*)
height = 1.5% of (P2y- Ply)
Scale
Off
Symbol mode
Off
Tick length
tp and tn = 0.5% of (P2 X — Plx) for
Y-tick and 0.5% of (P2 y — Ply) for
X-tick
Character set selected
Standard
Standard character set
Set 0
Alternate character set
SetO
Label terminator
ETX (ASCII decimal equivalent 3)
Character slant
0°
Mask value
223,0,0
REFERENCE MATERIAL C-5
Digitize clear
Pen velocity
Pen thickness
Chord angle
On
38.1 cm/s (15 in./s)
Set to 0.3 mm
Set to 5 degrees for AA, AR, and Cl
PI and P2 are changed only with the initialize instruction (IN). They
are not affected by device clear and the default instruction (DF).
HP-GL Error Messages
error 0
No error.
error 1
Instruction not recognized. The plotter has received an illegal
character sequence.
error 2
Wrong number of parameters. Tbo many or too few param¬
eters have been sent with an instruction.
error 3
Out-of-range parameters.
error 4
Not used.
error 5
Unknown character set. A character set out of the range
0-4, 6-9, 30-39 has been designated as either the standard or
alternate character set.
error 6
Position overflow. An attempt to draw a character (LB or UC)
or perform a CP that is located outside the plotter’s numeric
limit of -32 768 to -1-32 767.
error 7
Not used.
error 8
Vector received while pinch wheels raised.
RS-232-C Error Messages
0 No I/O error has occurred.
10 Output instruction received while another output instruction is ex¬
ecuting. The original instruction will continue normally; the one
in error will be ignored.
11 Invalid byte received after first two characters, , in a device
control instruction.
12 Invalid byte received while parsing a device control instruction.
The parameter containing the invalid byte and all following
parameters are defaulted.
13 Parameter out of range.
C-6 REFERENCE MATERIAL
14 Too many parameters received. Additional parameters beyond the
proper number are ignored; parsing of the instruction ends when
a colon (normal exit) or the first byte of another instruction is
received (abnormal exit).
15 A framing error, parity error, or overrun error has been detected.
16 The input buffer has overflowed. As a result, one or more bytes of
data have been lost, and therefore, an HP-GL error will probably
occur.
The No Operation Instructions, NOP
In order to maintain software compatibility with the 9872 plotter, the
7475 recognizes six 9872-related instructions as no operation NOP in¬
structions. These six NOP instructions are:
Automatic Pen Pickup AP Advance Full Page AF, PG, PGl
Adaptive Velocity VA Advance Half Page AH
Normal Velocity VN Enable Cutter EC
If these instructions are included in a program, they are recognized by
the 7475 and implemented as a NOP (i.e., they are ignored).
ASCII Character Codes
Numbers are often used as a code to represent not only values, but also
alphanumeric characters such as “A” or or “ x ” or “2”. One of the
most common computer codes used is ASCII 1 . ASCII is an eight-bit
code, containing seven data bits and one parity bit. The plotter uses
ASCII for most I/O operations. No parity bit is used. For example:
ASCII
ASCII
Character
Binary Code
Decimal Code
A
01000001
65
B
01000010
66
?
00111111
63
1 American Standard Code for Information Interchange.
REFERENCE MATERIAL C-7
A complete list of ASCII characters and their decimal representation
and the characters drawn by the plotter in each of the 19 character sets
are shown on the following pages. The 19 character sets are:
Set No.
Description
ISO Registration Number
SetO
ANSI ASCII
006
Set 1
9825 Character Set
—
Set 2
French/German
—
Set 3
Scandinavian
—
Set 4
Spanish/Latin American
—
Set 6
JIS ASCII
014
Set 7
Roman Extensions
—
Set 8
Katakana
013
Set 9
ISO IRV (International
Reference Version)
002
Set 30
ISO Swedish
010
Set 31
ISO Swedish For Names
Oil
Set 32
ISO Norway, Version 1
060
Set 33
ISO German
021
Set 34
ISO French
025
Set 35
ISO United Kingdom
004
Set 36
ISO Italian
015
Set 37
ISO Spanish
017
Set 38
ISO Portuguese
016
Set 39
ISO Norway, Version 2
061
C-8 REFERENCE MATERIAL
7475 ASCII Code Definitions
Decimal
Value
ASCII
Character
All Sets
0
NULL
No Operation (NOP)
1
SOH
NOP
2
STX
NOP
3
ETX
End Label Instruction
4
ETO
NOP
5
ENQ
NOP
6
ACK
NOP
7
BEL
NOP
8
BS
Backspace
* 9
HT
Horizontal Tab (V 2 backspace)
10
LF
Line Feed
11
VT
Inverse Line Feed
12
FF
NOP
13
CR
Carriage Return
14
SO
Select Alternate Character Set
15
SI
Select Standard Character Set
16
DLE
NOP
17
DCl
NOP
18
DC2
NOP
19
DC3
NOP
20
DC4
NOP
21
NAK
NOP
22
SYN
NOP
23
ETB
NOP
24
CAN
NOP
25
EM
NOP
26
SUB
NOP
27
ESC
NOP
28
FS
NOP
29
GS
NOP
30
RS
NOP
31
US
NOP
32
SP
Space
*Using control character horizontal tab (decimal 9) inside a label string moves
the pen one-half character space back (equivalent to a CP -.5,0). Use this tab
with character set 8, Katakana, where spacing between symbols can alter the
meaning of the symbol and hence the word or phrase.
NOTE: Shaded characters have the automatic backspace feature. ■
REFERENCE MATERIAL C-9
7475 ASCII Code Definitions (Continued)
C-10 REFERENCE MATERIAL
7475 ASCII Code Definitions (Continued)
REFERENCE MATERIAL C-ll
7475 ASCII Code Definitions (Continued)
C-12 REFERENCE MATERIA!
Subject Index
a
AA Instruction .
AR Instruction .
<ASC> .
Abort Device Control, ESC . J
Abort Graphic, ESC . K .
Absolute Direction Instruction, DI
Absolute Plotting .
Absolute Size Instruction, SI.
Acceleration.
Acknowledgment String.
Addressing the Plotter, HP-IB ...
Arc Absolute Instruction, AA
Arc Relative Instruction, AR.
ASCII Character Codes .
. 3-16 thru 3-18, B-l
. 3-18 thru 3-20, B-2
. 10-25
. 10-35,10-36, B-18
. 10-36, B-18
. 5-10, 5-25, 5-26, B-3
.3-1, 3-4
. 5-14, 5-16, 5-25, B-13
.1-5, 3-3
10-17,10-22,10-32 thru 10-35,10-41
. 9-2, 9-3, 9-6
. 3-16 thru 3-18, B-l
. 3-18 thru 3-20, B-2
.C-7 thru C-12
Bar Graphs . 1-15, 8-1, 8-9 thru 8-12
Baud Rate. 10-13
Binary Coding and Conversions . C-l
Binary-Decimal Conversions . C-l
Block Data Transfer Mode . 10-23,10-24,10-28,10-30
Block Size. 10-17,10-21,10-22,10-32,10-33,10-34,10-41
Break Signal . 10-6 10-7,10-8,10-26,10-27
Buffer Space . 10-14 10-15,10-17 thru 10-23,10-28,10-36,10-42
Bus Commands . 9-4
c
CA Instruction .
Cl Instruction .
CP Instruction.
CS Instruction.
Carriage-return Point .
CCITT V.24 Interface .
Character Grid .
Character Plot Instruction, CP ...
Character Sets.
Character Size.
Character Slant Instruction, SL ..
Character Space Field.
Circle Instruction, Cl.
Clipping .
Connecting the RS-232-C Interface
.5-3, 5-4, 5-7, B-2
. 3-11 thru 3-15, B-2
5-14, 5-15, 5-16,5-22,8-3,8-4, 8-9, B-2
.5-3,5-4, 5-7, B-3
. 5-8,5-10,5-11,5-14
1 - 1 , 1 - 2 , 10 - 1 , 10 - 2 , 10 - 10 , 10 - 11 , 10-12
. 5-20
. 5-14, 5-15, B-2
.5-2, C-7 thru C-12
. 5-16, 5-23, B-13
. 5-18, B-14
.5-1, 5-13, 5-20
. 3-11 thru 3-15, B-2
.2-1, 2-12, 2-14
. 10-10
SUBJECT INDEX SI-1
Subject Index (Continued)
Connector Cable, RS-232-C . 10-10,10-11,10-12
Current Pen Position. 3-1, 3-8, 5-8
d
DC Instruction . 6-3, B-3
DCL . 9-4
<DEC>. 10-25
DF Instruction .1-11, 3-4, 3-6, B-3
DI Instruction . 5-10, 5-23, 5-25, B-3
DP Instruction . 6-2, B-3
DR Instruction . 5-11, 5-24, 5-27, B-3
DT Instruction . 5-5, B-4
Data Block Size. 10-17,10-21, 10-22,10-32, 10-33
Data Terminal Ready Line Control. 10-17, 10-22,10-27
Data Transmission Mode. 10-23,10-24,10-27,10-28
Decimal Format . 1-7
Default Conditions. 1-12, C-5
Default Instruction, DF .1-11, 3-4, 3-6, B-3
Define Terminator Instruction, DT . 5-5, B-4
Designate Alternate Character Set, CA .5-3, 5-4, 5-7, B-2
Designate Standard Set Instruction, CS .5-3, 5-4, 5-7, B-3
Device Clear. 9-4
Device Control Instructions, RS-232-C . 10-1,10-2, 10-3,
10-24 thru 10-44, B-17, B-18, B-19
Digitize Clear Instruction, DC . 6-3, B-3
Digitize Point Instruction, DP . 6-2, B-3
Digitizing . 6-1, 6-2, 6-4
Digitizing Sight . 6-2
Documentation for the 7475 . 1-2
e
EA Instruction . 3-25, 8-10, 8-12, B-4
ER Instruction . 3-28, B-4
EW Instruction . 3-34, 8-15, B-4
ESC . ( . 10-7, 10-10, 10-26, B-17
ESC.) . 10-26, B-17
ESC . @ . 10-8,10-23, 10-27, 10-44, B-17
ESC . B . 10-19, 10-28,10-29, B-17
ESC . E . 10-14, 10-29, 10-30, B-17
ESC . H . 10-21, 10-22, 10-32,10-33,10-44, B-18
ESC .1 . 10-21,10-22,10-32,10-33,10-41,10-42,10-44, B-18
ESC . J . 10-35,10-36, B-18
SI-2 SUBJECT INDEX
Subject Index (Continued)
ESC . K . 10-36, B-18
ESC . L . 10-36, B-18
ESC . M. 10-18, 10-21,10-25,10-32,10-37, 10-44, B-19
ESC . N . 10-18,10-21,10-32, 10-38,10-41,10-44, B-19
ESC .0 . 10-42, B-19
ESC . R . 10-44, B-19
ESC . Y . 10-7, 10-10,10-26, B-17
ESC . Z . 10-26, B-17
E-mask . 1-13, 1-14
Eavesdrop Environment, RS-232-C. 10-4
Echo Terminate Character . 10-16, 10-18, 10-21,
10-22, 10-33, 10-35, 10-37, 10-40
Edge Rectangle Absolute Instruction, EA. 3-25, 8-10, 8-12, B-4
Edge Rectangle Relative Instruction, ER . 3-28, B-4
Edge Wedge Instruction, EW . 3-34, 8-15, B-4
Endline Environment . 10-3
Enquire/Acknowledge Handshake. 10-15, 10-21, 10-22,
10-23, 10-32 thru 10-35,10-43
Enquiry Character. 10-16, 10-21, 10-22, 10-32 thru 10-35, 10-41
Error Light.7-6, 10-14, 10-29, 10-30
Error Messages, HP-IB. 7-5, C-6
Error Messages, RS-232-C . 10-29, 10-30, C-6
ETX, End of Text Character . 1-7, 5-5, 5-6, 5-11
Extended Status . 10-42, 10-43
External Clock . 10-13,10-14
f
FT Instruction.
Fill Type Instruction, FT
h
HP-GL Error Status ....
HP-GL Instruction Set .
HP-GL Syntax .
HP-IB.
HP-IB Implementation .
HP-IB Interfacing .
Half Duplex .
Handshake Mode 1 ....
Handshake Mode 2 ....
Handshaking .
3-21,8-10, 8-12, 8-13, 8-15, B-5
3-21,8-10, 8-12, 8-13, 8-15, B-5
. 1-14, 7-5, C-6
1-6,1-8 thru 1-10, B-l thru B-16
... 1-6 thru 1-10, B-l thru B-16
.7-6, A-l thru A-8
.9-2, A-2, A-3
.9-1 thru 9-6, A-l thru A-8
. 10-10
. 10-32,10-33,10-34
. 10-32,10-33,10-34
. 10-15 thru 10-23
SUBJECT INDEX SI-3
Subject Index (Continued)
Hard-clip Area. 2-12
Hardwire Handshake . 10-15, 10-22, 10-27
Hewlett-Packard Interface Bus. 1-1, 9-2, A-l thru A-8
Hewlett-Packard Graphics Language. 1-1, 1-5, 1-6
i
IFC . 9-4
IM Instruction. 1-14, 6-7, B-6
IN Instruction . 1-13, 3-4, 3-6, 8-2, B-6
IP Instruction . 2-7, B-6
IW Instruction. 2-12, B-7
Immediate Response String . 10-16, 10-21, 10-38
Initialize Instruction, IN . 1-13, 3-4, 3-6, 8-2, 8-3, B-6
Input Mask Instruction, IM. 1-14, 6-7, B-6
Input PI and P2 Instruction, IP. 2-7, B-6
Input Window Instruction, IW . 2-12, B-7
Instruction Syntax, HP-GL . 1-6
Instruction Syntax, RS-232-C . 10-25
Integer Format . 1-7
Intercharacter Delay. 10-16, 10-18, 10-21, 10-33, 10-38, 10-40, 10-41
Interface Bus Concepts.A-l
Interface Clear . 9-4
I
LB Instruction. 5-7, 8-4, B-7
LT Instruction .4-6, 8-6, 8-7, B-7
Label Fields .1-7, 5-7
Label Instruction, LB . 5-7, 8-4, B-7
Label Terminator .5-6, 5-7
Labeling with Variables .5-8, 5-9
Leased Lines Monitoring Mode . 10-13
Line Feed . 1-6, 5-14, B-l
Line Graphs. 1-17, 8-1 thru 8-9
Line Type Instruction, LT .4-6, 8-6, 8-7, B-7
Listener. 9-6
m
Model . 10-32,10-33,10-35
Mode 2 . 10-32,10-33
Modem. 10-4
Monitor Mode . 10-8, 10-11, 10-27, 10-28
SI-4 SUBJECT INDEX
Subject Index (Continued)
n
NOP, No Operation Instruction. C-7
Normal Mode. 10-23
o
OA Instruction . 7-2, 8-11, B-8
OC Instruction . 7-3, B-8
OD Instruction . 6-3, B-8
OE Instruction . 7-5, B-8
OF Instruction . 7-6, B-9
OH Instruction . 2-13, B-9
OI Instruction . 7-6, B-9
00 Instruction . 7-6, B-9
OP Instruction . 2-8, B-10
OS Instruction. 6-5, 7-7, B-10
OW Instruction . 2-13, B-10
On-line, Programmed Off State . 10-6
On-line, Programmed On State .10-3, 10-7, 10-26
Optional Parameters. 1-7, 1-8, 10-25
Output Actual Position
and Pen Status Instruction, OA. 7-2, B-8
Output Buffer Size, ESC . L . 10-36, B-18
Output Buffer Space Instruction, ESC . B. 10-28, 10-29, B-17
Output Commanded Position
and Pen Status Instruction, OC . 7-3, B-8
Output Digitized Point
and Pen Status Instruction, OD. 6-3, B-8
Output Error Instruction, OE . 7-5, B-8
Output Extended Error Instruction, ESC . E .... 10-29, 10-30, B-17, C-6
Output Extended Status Instruction, ESC .0 . 10-42, 10-43, B-19
Output Factors Instruction, OF . 7-6, B-9
Output Hard-clip Limits Instruction, OH . 2-13, B-9
Output Identification Instruction, OI . 7-6, B-9
Output Initiator Character .10-16, 10-18, 10-21, 10-33, 10-38
Output Options Instruction, OO . 7-6, B-9
Output PI and P2 Instruction, OP . 2-8, B-10
Output Status Instruction, OS . 6-5, 7-7, B-10
Output Terminator . 7-1, 7-2, 10-16, 10-18,
10-21, 10-22, 10-33, 10-37,10-38, 10-41
Output Trigger Character . 10-15, 10-18, 10-21, 10-22, 10-33, 10-40
Output Window Instruction, OW . 2-13, B-10
SUBJECT INDEX SI-5
Subject Index (Continued)
PA Instruction.3-1, 3-4 thru 3-8, 8-6, B-ll
PD Instruction .3-2, 3-4 thru 3-8, 8-6, B-ll
PR Instruction. 3-1, 3-8, 3-9, 3-10, B-ll
PS Instruction . 1-16, B-ll
PT Instruction. 3-22, 8-12, 8-15, B-12
PU Instruction .3-2, 3-4 thru 3-8, 8-6, B-12
P-mask . 1-14, 1-15, 9-5
P1,P2 . 2-5 thru 2-11, 5-12, 5-16, 5-23 thru 5-28, 8-2
Paper Size Instruction, PS. 1-16, B-ll
Paper Switch . 2-2, 2-3, 7-3
Parallel Poll . 1-14, 1-15, 9-5, A-l
Parameter Interaction in Labeling Instructions . 5-23 thru 5-28
Pattern Number . 4-6, B-5
Pen Down.3-2 thru 3-8, 5-19, 5-20, B-ll
Pen Instructions, PU and PD .3-2, 3-4 thru 3-8, 8-7, B-ll, B-12
Pen Select Instruction, SP . 3-3, 8-2, 8-12, 8-13, 8-15, B-14
Pen Thickness Instruction, PT. 3-22, 8-12, 8-15, B-12
Pen Up .3-2, 3-8, 5-21, B-12
Pen Velocity . 1-5, 3-3, 3-4
Personal Computer . 10-2, 10-3
Pie Charts. 1-17, 8-1, 8-13 thru 8-15
Pin Allocations, RS-232-C . 10-11, 10-12
Plot Absolute Instruction, PA .3-1, 3-4 thru 3-8, 8-6, B-ll
Plot Relative Instruction, PR . 3-1, 3-8, 3-9, 3-10, B-ll
Plotter Address . 9-2, 9-3, 9-6
Plotter Character Sets. 5-2, C-7 thru C-12
Plotter Environments, RS-232-C . 10-2 thru 10-10
Plotter Instruction Set. 1-5, 1-6, 1-8
Plotter Off Instruction, ESC .). 10-26, B-17
Plotter On Instruction, ESC . ( . 10-26, B-17
Plotter Output . 7-2
Plotter Syntax, 9872 . 1-7,3-11
Plotter Unit . 2-5
Plotter Unit Equivalent .3-1, 3-8
Plotting Area. 2-2
Plotting with Variables.3-10, 8-6
Preparing Your Plotter for Digitizing . 6-2
RA Instruction . 3-23, 8-10, 8-12, B-12
RO Instruction . 2-14, B-12
SI-6 SUBJECT INDEX
Subject Index (Continued)
RR Instruction . 3-26, B-13
RS-232-C Interface . 1-1, 10-1, 10-10, 10-11, 10-12
RS-232-C Interfacing . 10-1 thru 10-12
RS-232-C Plotter Output . 7-2
Receiving Data, HP-IB . 9-10
Relative Direction Instruction, DR . 5-11, 5-24, 5-27, B-3
Relative Plotting. 3-1, 3-8, 3-9
Relative Size Instruction, SR . 5-17, 5-25 thru 5-28, B-14
Reset Handshake Instruction, ESC . R . 10-44, B-19
Rotation Coordinate System Instruction, RO . 2-14, B-12
s
SA Instruction.5-4, 5-5, 5-7, B-13
SC Instruction. 2-9, 8-2, B-13
SDC . 9-4
SI Instruction . 5-16, 5-23, B-13
SL Instruction . 5-18, B-14
SM Instruction . 4-4, 5-29, B-14
SP Instruction . 3-3, 8-2, 8-12, 8-13, 8-15, B-14
SR Instruction. 5-17, 5-25 thru 5-28, B-14
SS Instruction .5-3, 5-4, 5-7, B-15
S-mask. 1-14, 1-15, 6-7
Scaled Decimal Format . 1-7
Scale Instruction, SC. 2-9, 8-2, B-13
Scaling . 2-1, 2-9, 2-10, 2-11, 8-2, C-2
Scaling Points . 2-1, 2-5 thru 2-11, 5-17, 5-24 thru 5-28, 8-2
Scaling Without Using the SC Instruction . 2-9, 2-10, C-2
Select Alternate Set Instruction, SA .5-4, 5-5, 5-7, B-13
Select Pen Instruction, SP . 3-3, 8-2, B-14
Select Standard Set Instruction, SS .5-3, 5-4, 5-7, B-15
Selective Device Clear. 9-4
Sending Data, HP-IB . 9-7
Serial Poll.6-7, 9-4
Service Request.6-7, 1-14
Set Extended Output and Handshake Mode . 10-18, 10-21, 10-32,
10-38, 10-41, 10-44, B-19
Set Handshake Mode 1 Instruction, ESC . H. 10-21, 10-22,
10-30, 10-32, 10-44, B-18
Set Handshake Mode 2 Instruction, ESC .1. 10-21, 10-22,
10-29, 10-30, 10-33,10-41, 10-42, 10-44, B-18
Set Output Mode, ESC . M. 10-18, 10-21, 10-25,
10-32, 10-37, 10-44, B-19
SUBJECT INDEX SI-7
Subject Index (Continued)
Set Plotter Configuration Instruction, ESC . @. 10-8, 10-23,
10-27, 10-44, B-17
Setting the Scaling Points . 2-5
Manually . 2-6
Programmatically .2-7, 8-2
Setting Up the Plotter, RS-232-C . 10-2
Shade Rectangle Absolute Instruction, RA. 3-23, 8-10, 8-12, B-12
Shade Rectangle Relative Instruction, RR . 3-26, B-13
Shade Wedge Instruction, WG . 3-31, 8-15, B-16
Shift-in .5-3, 5-4
Shift-out .5-4, 5-5
Slant Instruction, SL. 5-18, B-14
Software Checking Handshake . 10-15, 10-18, 10-27
Spacing Between Characters .5-7, 5-13
Stand-alone Environment . 10-3
Standard Character Set . 5-2, 5-3, 5-4
Stop Bits . 10-14
Switched Lines Monitoring Mode . 10-13
Symbol Mode Instruction, SM .4-4, 4-5, 4-6, B-14
t
TL Instruction. 4-2, B-15
Talker. 9-6
Terminal . 10-4 thru 10-10
Terminal-only Environment . 10-9, 10-10
Terminator. 1-6 thru 1-8
Tick Instructions, XT and YT. 4-2, B-16
Tick Length Instruction, TL . 4-2, 8-3, B-15
Tick Marks.4-2, 8-3
Transmission Errors, RS-232-C . 10-14
Turnaround Delay . 10-16, 10-18, 10-21,
10-22, 10-33, 10-37, 10-40, 10-41
u
UC Instruction . 5-19, B-15
Unit Systems. 2-5
User Defined Character Instruction, UC. 5-19, B-15
User Units . 2-5, 2-9, 8-2
Using the Plotter with a Computer Mainframe,
RS-232-C . 10-2
SI-8 SUBJECT INDEX
Subject Index (Continued)
Using the Plotter with a Personal Computer,
RS-232-C . 10-2
Using the Plotter with a Terminal. 10-4,10-9
v
VS Instruction. 3-3, B-15
Velocity Select Instruction, VS . 3-3, B-15
w
WG Instruction . 3-31, 8-15, B-16
Window . 2-1
Window, Outputting the. 2-13
Setting the . 2-12
x
XT Instruction. 4-2, 8-3, B-16
Xoff Threshold Level. 10-17,10-34,10-35
Xoff Trigger Character . 10-17, 10-20, 10-21,10-32,10-35
Xon Trigger Character .10-17, 10-20,10-21,10-34
Xon-Xoff Handshake. 10-15, 10-20, 10-32 thru 10-35,10-40
y
YT Instruction. 4-2, 8-4, B-16
SUBJECT INDEX SI-9
Getting Started
0 HP-IB Interfacing
Establishing Boundaries and Units
9 RS-232-C/CCITT V.24 Interfacing
Controlling the Pen and Plotting
9 An HP-IB Overview
Enhancing the Plot
Instruction Syntax
Labeling
Reference Material.
Digitizing
Obtaining Information from the Plotter
Putting the Instructions to Work
PART NO. 07475-90001
Who\ HEWLETT
\HttM PACKARD
OCTOBER 1984
PRINTED IN U.S.A.